-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
rake db:reset propagates migrations #22
Comments
Just tried with the latest |
Hey, thanks for reporting this, I'll try to look into it next week. Which DB are you using? MySQL? and which version? |
Reproduced on my other Mac with following specs:
|
The original machine where I tackled it first is running:
|
And reproduced on server as well:
|
I've created a temporary rake task to be used instead of the standard |
Thanks for all the details, I'll let you know as soon as I have time to work on this issue. Thanks! |
No probs, I'm just pushing it all here for the reference before I forget. I'll take a look myself too and if there's some more time, I'll push a PR for you :) |
Sorry for not looking at this earlier, I'm trying to do some cleanups with all the open issues. Is this still an issue? |
Hey, I'll have to try. I'm running a specific task to reset it cleanly. Will disable and try the original way. Stay tuned. |
Just tried the most recent |
After re-reading the original issue, I'm wondering if this is actually a bug or "expected" behavior.
Running
This is useful when you generate a new seed migration after a This is similar to what The assumption we're making here is that your seed migrations should affect models that you register in seed migrations, so when you run So it seems to me like this is expected behavior, in that case, we should maybe edit the README to make this more explicit. Let me know if you have any questions or if anything isn't really clear. PS: Thanks again for taking the time to look into this old issue, and for your other contribution to this gem :) |
Good point. About my use-case: I'm using it to automate data population, so time-to-time, esp. prior going live, the database is wiped clean with initial data seeded in, sometimes tens of millions of records. Sort of full reset. What about some |
I'm not against adding new features to the gem to support new use cases, but first I want to make sure I clearly understand your situation. If all the models that store the data that you need to seed for the new environment are registered in the initializer, then every time your run a seed migration your seeds.rb should contain all the data you need. Are you not registering certain models because the seeds file would become to big if we're talking about millions of records? or are there other considerations? |
Following your suggestion of using something like Run all the seed migrations even if they were run before:
Run a specific migration even if was run before:
Rake doesn't make it easy to use command line args like |
@pjambet I'd change this issue from |
Indeed, just updated this. |
Weird problem, whenever I ran
rake db:reset
all the tables are nicely emptied except for theseed_migration_data_migrations
which effectively displays all data migrations, it's not empty.Truncating it manually and running
db:reset
again fills it up every time, but no seed migration actually happens.Ideas?
The text was updated successfully, but these errors were encountered: