ruby on rails - Best Practice for DB Migrations that Affect Many Tables -
say have database of 50 tables. making change wording of 1 of columns relationship affects 20 of tables. how set migration? see @ least 3 possibilities
- a separate migration change on every table
- a single migration of them
- changing initial declaration of creation of tables.
i'm quite confident 3 worst approach because cannot migrate have rebuild entire schema. i'm stuck between 1 , 2. 2 best approach because creating 1 migration 1 change happens affect lot of tables. i'm leaning towards. on other hand, feels messy.
any resources on appreciated well. thanks
it makes more sense go option 2.
say take option 1 , x separate migrations. you'll end x migrations mess database's integrity, you'll have run them (or rollback them if want undo changes). if changes need made together, makes sense put them in same file
Comments
Post a Comment