Skip to content
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

Set the ActiveRecord::Schema version when running the app:update task #44356

Merged
merged 2 commits into from Feb 8, 2022

Conversation

rafaelfranca
Copy link
Member

See #44286 for the description of the problem.

This PR backport that feature and use the app:update task to make the upgrade easier.

Without it people would need to dump the database schema using Rails 7.0 before loading.

@kamipo
Copy link
Member

kamipo commented Feb 8, 2022

Do we need to backport #44286 in 7-0-stable?

Actually the problem #43909 is due to #42297 changed the implicit default but didn't care the previous implicit default as precision: nil.

So I think just #44358 with re db:schema:dump is a reasonable solution to me.

@rafaelfranca
Copy link
Member Author

We don't need to backport, but I prefer to do it. It is a small feature but make easier to people to upgrade. Asking people to run db:schema:dump while is equivalent to ask people to run app:update requires a database connection and it to already be with the correct schema loaded in Rails 6.1. That is more likely for people to mess up.

@rafaelfranca rafaelfranca merged commit 9f85a68 into 7-0-stable Feb 8, 2022
@rafaelfranca rafaelfranca deleted the 7-0-stable-schema-version branch February 8, 2022 16:12
@matthewd
Copy link
Member

matthewd commented Feb 9, 2022

Yeah, it otherwise technically requires a sequence of db:schema:load, [bump gemfile], app:update, db:schema:dump... which isn't terrible, but it just feels like avoidable complication. (Particularly, given how small this change is -- we're building on existing shipped migration-versioning support, so risk/reward seems worthwhile.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants