-
Notifications
You must be signed in to change notification settings - Fork 0
Fix MySQL JSON default and load engine migrations #33
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,13 @@ class Engine < ::Rails::Engine | |
| app.config.assets.paths << Engine.root.join("app/javascript") | ||
| end | ||
|
|
||
| initializer "coplan.append_migrations", before: :load_config_initializers do |app| | ||
| config.paths["db/migrate"].expanded.each do |path| | ||
| app.config.paths["db/migrate"] << path | ||
| ActiveRecord::Migrator.migrations_paths << path | ||
|
Comment on lines
+21
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Appending Useful? React with 👍 / 👎. |
||
| end | ||
| end | ||
|
|
||
| initializer "coplan.factories", after: "factory_bot.set_factory_paths" do | ||
| if defined?(FactoryBot) | ||
| FactoryBot.definition_file_paths << Engine.root.join("spec", "factories") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this change,
downno longer removes rows inserted intocoplan_users, so a rollback/re-migrate cycle (db:rollback STEP=1thendb:migrate) will re-run theINSERT INTO coplan_users ... SELECT ... FROM usersand hit duplicate primary-key/unique-key errors for existing users. This affects environments that test or rely on rollback/redeploy workflows.Useful? React with 👍 / 👎.