Questions tagged [seeding]

525 questions
0
votes
0 answers

Laravel DB Seeding Without Foreign Keys

An issue was created about 6 months ago for Laravel Database Seeding. The issue was about how MySQL prevented the truncation of a table due to its foreign key constraints. Tayor Otwell (the creator of Laravel) stated the following in his…
erj1
  • 79
  • 3
0
votes
1 answer

Artisan db:seed (Laravel 4) receiving error on mediatemple gridserver even though php version is 5.5.0

I have a few seed files that make use of arrays that use the convention: Array = [ ]; The array uses brackets instead of parentheses. I have checked my php version using a phpinfo.php file, and it is reading: PHP Version 5.5.0 When I try to run…
user1072337
  • 12,615
  • 37
  • 116
  • 195
0
votes
1 answer

DB:seed file for Laravel 4 working fine on local host, not working on Mediatemple gridserver?

I have a Laravel 4 db:seed file that I am trying to use on mediatemple gridserver. I was able to run a migration with artisan fine (php artisan migrate), and make the tables, but I am not able to seed the tables. This database seeding worked fine…
user1072337
  • 12,615
  • 37
  • 116
  • 195
0
votes
2 answers

can find_or_create_by_name update?

when using find_or_create_by_name in rails, if the table is found and you pass in parameters for other attributes, will it update the table? for example: College.find_or_create_by_name(name: 'University of Pittsburgh', calendar: 'semester') Say…
Adam Zerner
  • 17,797
  • 15
  • 90
  • 156
0
votes
1 answer

to force system seed for Javascript mat.random() method

I would like to know how I could force the system seed each time I call math.random() method on JavaScript. Thanks Roge
0
votes
2 answers

Rails seed.rb can't find table that exists in schema and SQL

Class is a reserved word, so I have changed the table name from class_assignment to cassignments to avoid any chance that that is the error causing it (despite me having class_instruction(s). I have tried plural and singular versions, and still…
chris Frisina
  • 19,086
  • 22
  • 87
  • 167
0
votes
1 answer

How to control RoR I18n texts stored in database?

I'm using the I18n Gem from Sven Fuchs in my Ruby on Rails 3.2 Application and while the gem works great I came across a situation, which I don't know the solution to: I have a seed file, which contains the basic translation for my MVC's and is…
Thomas
  • 790
  • 6
  • 17
0
votes
2 answers

what is the proper syntax for seeding a child table?

I'm trying to seed a parent table and a child table. Seeding the parent works fine but I don't know the syntax for seeding the child. Please help. Contact.delete_all Customer.delete_all b=[] c=[] b[0]=[1231215,'Jeremy', 'G',…
stevo999999
  • 588
  • 4
  • 12
0
votes
2 answers

what is the proper syntax for seeding a database with an array?

I am a rails noob and I am trying to seed my database with an array and then a loop to fill assign the relevant code to the relevant variable. However, it isn't working. Please help. Customer.delete_all b[0]=[1231215,'Jeremy', 'G',…
stevo999999
  • 588
  • 4
  • 12
0
votes
1 answer

Can't get Seeding to Work EF Code First

I have a couple of related entities and I am trying to seed the database with some dummy data. Here is my seed code: public class EventInitializer : DropCreateDatabaseAlways { protected override void Seed(BSContext context) { …
J86
  • 14,345
  • 47
  • 130
  • 228
0
votes
3 answers

Viewing seed results in rails console

I have created a seed file, ran rake db:migrate and rake db:seed everything seemed to have run fine. However, I would now like to view the seeds in rails console, the name of the table is usersinfo. How do I view to verify that the seeds populated…
FluxEngine
  • 12,730
  • 14
  • 57
  • 83
0
votes
1 answer

Entity Framework - seeding database - does PK need to be included in Seed method?

Following the MVC Music Store tutorial, the database is seeded with sample data. The Album class is as follows: namespace MvcMusicStore.Models { public class Album { public int AlbumId { get; set;} // ... …
0
votes
1 answer

ASP.NET MVC EF Seeder can't delete rows because foreign key relationships

I have a seeder for my Entity framework, a function ResetTables(), which deletes all rows from all tables, then reseeds them all. Foreign key relationships are blocking my delete statements, I managed to get around the issue for awhile by deleting…
williamsandonz
  • 15,864
  • 23
  • 100
  • 186
0
votes
2 answers

Why is rake db:seed not behaving as expected?

I am trying to seed my database in a very particular manner. Here is my /db/seeds.rb file: # creates a school in a local database. test_school = School.find_or_create_by_email(school_name: "Test School One", client_user_name: 'admin',…
E.E.33
  • 2,013
  • 3
  • 22
  • 34
0
votes
2 answers

rake db:seed failing on production server

Can some one make sense of this output? Its been a very long day and my eyes are glazing over. Yesterday it seemed to work fine. rake db:seed --trace rake aborted! cannot load such file --…
bytemonger
  • 83
  • 7
1 2 3
34
35