I just released my first gem, Data Migrate.
The short:
Create migrations for data the same way you'd do it for your schema. Go forward, back, up, down, etc, just data, or smartly in conjunction with the schema.
For more explanation and usage:
http://ajvargo.com/2011/05/data_migrate/
https://github.com/ajvargo/data-migrate
Best,
Andrew
Could you explain the benefit of having data migrations separate from schema migrations? Or perhaps explain a scenario that would be painful without data migrations but easy with them?
Thanks,
Wyatt
> --
> You received this message because you are subscribed to the Boston Ruby Group mailing list
> To post to this group, send email to boston-r...@googlegroups.com
> To unsubscribe from this group, send email to boston-rubygro...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/boston-rubygroup
I can't tell for sure, but it looks like this might alleviate a specific painpoint I have run into when deploying a whole bunch of migrations at once when some of them adjust data.
Imagine that at some point you add a data migration which uses AR. In a future commit, you add a new column. In another commit, you add validations to this column, and a new data migration to bring your records into compliance.
Being able to run all of your schema migrations _and then_ all of your data migrations which use the model might be useful in this case.
I am probably not being clear, but I have occasionally reordered my data migrations to the end of a chain.