-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priority run seed #718
Comments
hi @visavi at the moment the only way is to run them manually, e.g:
Other tools accomplish this by having a master seeding class that essentially calls Seeders in the relevant order. We could look into something similar in the future if many users request this. |
#719 priority seeds |
👍 for this feature |
Definitely voting for this feature ... is #719 still an active PR? |
there is now an opportunity to put multiple seeders, http://docs.phinx.org/en/latest/seeding.html#executing-seed-classes but still it is not very convenient, as an option to make a master file in which you can specify a list of files and they will be carried out in an orderly fashion, like in laravel5 |
@visavi Something like the L5 way to do it would be nice... or even to improve on L5, the ability to create not just one super class that loads a single list of seeders, but a super class that loads a list of seeders based on arrays (a structure similar to the L5 middleware class)... I guess I was just wondering between #719 #737 and #790 it seems like work has been done, even some without any merge conflicts, though I don't know if testing has succedded... Does @robmorgan have any thoughts on whether this is an issue that needs someone else to take a stab at it or if the proposed PRs satisfy the initial proposal he outlined. |
+1 from me |
+1 for this |
+1 |
1 similar comment
+1 |
That is a really useful feature, when we will be able to see it merged? |
+100 |
+1 simpliest way to "solve" this issue is to prefix classes with letters. Let's say you want to seed Post and User table and Post are related to Users so you want Users to be seeded first. Call your seed classes as AUserSeeder and BPostSeeder and you'll get them in correct order. Maybe instead of some "Master seeder" that would run "child seeders" in correct order, simpy add order method that would return an integer so you could put seeders in correct order? |
Hey, I created pull request for seeds ordering feature: Please review my pull request and comment if you like it. |
PR open. |
For example, I have 2 files, PostsSeeder and UsersSeeder
between them have connections with foreign keys
if you run the seed:run, an error occurs because the first perform PostsSeeder, and it requires a user
how to make so that UsersSeeder run earlier than PostsSeeder?
Option to rename the file do not really like, as tables in a database, and a lot of Seed files too much
You can get lost
The text was updated successfully, but these errors were encountered: