-
Notifications
You must be signed in to change notification settings - Fork 83
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
Migration from globalize
: foreign keys
#641
Comments
I'm not really sure what happened there, but you have to include |
I'm closing this since it's not clear how to proceed here. These things are well-documented in tests, if something isn't working then isolate the problem and make a PR with a fix, or one with a test that is failing on the bug. |
No, definitely not, you shouldn't need them. If they were added by Mobility that could be a bug, but if so I've never heard of it. |
Context
At MaMpf, we migrated from
globalize
tomobility
. Everything worked flawlessly with the help of your migration guide.Recently, we noticed that we had a few migrations using the
create_translation_table!
method only provided byglobalize
. We noticed this since we setup our dev environment by running through every migration starting from an empty database. We only recently discoveredrails db:schema:load
which we will make use of in the future to avoid these problems where migrations cannot run through anymore as they use outdated code.Just for testing purposes, in MaMpf-HD/mampf#654, we deleted those non-working migrations and completely setup the database again by deleting it entirely (also its schema), then running through all migrations. After that, we used the generator provided by
mobility
to generate the respective translation tables again:Expected Behavior
We expected the
schema.rb
to only differ in minor details.Actual Behavior
However, if you look at the diff, we made the following observations (also described in MaMpf-HD/mampf#655):
t.text "name"
was added to the tablesubjects
,programs
anddivisions
. However, this field already exists in the respective translation tables, so we don't know why we would need it in the associated table as well. ->mobility
has been working fine for us during the last few months even without these fields. Should we add them via another migration? However, this was not documented in your migration guide.Possible Fix
Add the changes from the
schema.rb
diff manually by means of new migrations.The text was updated successfully, but these errors were encountered: