-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrations not namespaced by database in Rails 6 #36205
Comments
I'm not 100% sure, have you tried defining the path?:
|
Specifying the migration path works
now if I run |
I have no idea, this is a really new feature. I think there's definitely room for improvement, having multi DB in Rails it's a big accomplishment!
I think it could be to make apps with a single DB behave in the same way than before these changes. |
I'm not sure where is the documentation for multi DB (because lazy bones) but I can read the first PR related to this https://github.com/rails/rails/pull/32274/files |
Hey - this is definitely a documentation issue. We haven't gotten around to writing docs yet but will get them done for the final release. The database stuff has been influx throughout the last year. Sorry for the confusion!
|
@eileencodes I don't know if I can help in anyway with the documentation since a very new feature but if you think I can let me know 🙌 . |
Fixed in #36389 |
That looks great |
Steps to reproduce
rails new project5
bin/rails g migration create_dogs --database=animals
Expected behavior
The migration file gets created under db/migrate/animals
Actual behavior
The migration file gets created under db/migrate
System configuration
Rails version: 6.0.0.rc1
Ruby version: 2.5.0p0
I am trying to understand if I am doing something wrong or the migrations don't get created in the right folder.
I am trying to create an app with 2 databases that have different structures.
Here is the config that I have in config/database.yml file
When I run
bin/rails g migration create_users
the 2019..._create_users.rb migration get's created underdb/migrate
folder. I expect this to get created underdb/migrate/primary
.The same happens when I run
bin/rails g migration create_dogs --database=animals
. The file2019..._create_dogs.rb
gets created underdb/migrate
and I expect this to get created underdb/migrate/animals
If I then go ahead and migrate the database then Rails does create 2 schemas under the db folder (schema.rb and animals_schema.rb), however they both have the same content.
Project to reproduce: https://github.com/ionut998/project5
The text was updated successfully, but these errors were encountered: