Skip to content

Conversation

@JoeDupuis
Copy link
Contributor

@JoeDupuis JoeDupuis commented Oct 9, 2024

Fixes #53216

db:migrate:reset is broken, because we started to load the schema before migrating. This prevents migrations from running. This patch empties the schema before migrating, ensuring that migrations run as expected.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Fixes rails#53216

`db:migrate:reset` is broken, because we started to load the schema
before migrating. This prevents migrations from running. This patch
empties the schema before migrating, ensuring that migrations run as
expected.
@JoeDupuis JoeDupuis force-pushed the fix-db-migrate-reset branch from b2825e0 to b62fb1e Compare October 11, 2024 00:08
@rails-bot rails-bot bot added the railties label Oct 11, 2024
@rafaelfranca
Copy link
Member

We can't do this because we don't know if the files inside db/migrate can recreate the full schema. The current behavior is correct. Why people want to run the migrations?

@rafaelfranca
Copy link
Member

Actually. Looking at the documentation this changes makes sene

@rafaelfranca rafaelfranca merged commit aeb0828 into rails:main Oct 15, 2024
@JoeDupuis
Copy link
Contributor Author

JoeDupuis commented Oct 15, 2024

Thank you!

Yeah, db:migrate is what is needed 99% of the time, but db:migrate:reset is useful to speed up the feedback loop while working on complex migrations that can't be easily reverted.

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.

[ActiveRecord] Broken db:migrate:reset

2 participants