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

  1. a separate migration change on every table
  2. a single migration of them
  3. 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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -