MrDys / blacklight

Blacklight Plugin
http://projectblacklight.org/
Other
1 stars 1 forks source link

document migration path for live data #501

Closed MrDys closed 12 years ago

MrDys commented 12 years ago

CODEBASE-316: How do you point a rails3 BL at your existing databases from rails2 BL, while still having your migrations in sync? (Since there will be some new migrations in your app, for which populated tables already exist).

Any other data migration issues? (Oh yeah, add user_type column to needed tables, populate null values with "User").

Or should we just tell people they have to create brand new databases with bl3 migrations, and then copy the data over? (Still need to make sure null "user_type" columns get set.)

Need to provide a clear path and document it.

UPDATE: the user_type field is not auto populated as part of the migration that adds this field - it is set to the correct class name by the generator. The generators do not overwrite any existing migrations, it will only add new migrations that do not yet exist in the hosting application. So unless someone went in and deliberately deleted the original blacklight migrations there should not be a problem running the generator on an existing installation. As for Hydra - I think it would be a good idea to have the Hydra generator /call/ the blacklight generator. We might also add a hook or clue - so that Hydra can clearly identify if the blacklight generator was alredy run. but taht seems like a different ticket than this one.

MrDys commented 12 years ago

Original reporter: jrochkind

MrDys commented 12 years ago

jrochkind: From the call notes, have asked Jason to maybe give us more info here?

"Jason had trouble upgrading to rails 3 b/c of the migrations. You might need to remove your older blacklight migrations. We have migrations in hydra that assume you've already run the blacklight migrations. This should work fine, we just need to run the blacklight generator before the hydra generator. "