diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-10-22 16:49:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-22 16:49:31 -0400 |
commit | e853acb9b4cfb5bb91a241cf37084631cd145823 (patch) | |
tree | e9d379e876daa4541bb06c42618c0504038192db /railties | |
parent | 9e04563ae0c488d056861965400874f6102e14f1 (diff) | |
parent | 4f1295129b22f435641c4d63a15bfd4395db98ca (diff) | |
download | rails-e853acb9b4cfb5bb91a241cf37084631cd145823.tar.gz rails-e853acb9b4cfb5bb91a241cf37084631cd145823.tar.bz2 rails-e853acb9b4cfb5bb91a241cf37084631cd145823.zip |
Merge pull request #34222 from bogdanvlviv/unify-changelog-entries
Unify changelog entries related to `database` option of Rails generators [ci skip]
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index eaa2353701..f94b67a0ac 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -17,34 +17,18 @@ *DHH*, *Lachlan Sylvester* -* Refactors `migrations_paths` command option in generators - to `database` (aliased as `db`). Now, the migrations paths - will be read from the specified database configuration in the - current environment. +* Add `database` (aliased as `db`) option to model generator to allow + setting the database. This is useful for applications that use + multiple databases and put migrations per database in their own directories. ``` - bin/rails g model Chair brand:string --database=kingston - invoke active_record - create db/kingston_migrate/20180830151055_create_chairs.rb - ``` - - `--database` can be used with the migration, model, and scaffold generators. - - *Gannon McGibbon* - -* Adds an option to the model generator to allow setting the - migrations paths for that migration. This is useful for - applications that use multiple databases and put migrations - per database in their own directories. - - ``` - bin/rails g model Room capacity:integer --migrations-paths=db/kingston_migrate + bin/rails g model Room capacity:integer --database=kingston invoke active_record create db/kingston_migrate/20180830151055_create_rooms.rb ``` Because rails scaffolding uses the model generator, you can - also specify migrations paths with the scaffold generator. + also specify a database with the scaffold generator. *Gannon McGibbon* @@ -72,15 +56,15 @@ *Yoshiyuki Kinjo* -* Add `--migrations_paths` option to migration generator. +* Add `database` (aliased as `db`) option to migration generator. If you're using multiple databases and have a folder for each database for migrations (ex db/migrate and db/new_db_migrate) you can now pass the - `--migrations_paths` option to the generator to make sure the the migration + `--database` option to the generator to make sure the the migration is inserted into the correct folder. ``` - rails g migration CreateHouses --migrations_paths=db/kingston_migrate + rails g migration CreateHouses --database=kingston invoke active_record create db/kingston_migrate/20180830151055_create_houses.rb ``` |