You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Pull Request has been created for the Rails core team to review reverting sorted schema columns.
This is based on the findings outlined in discussion on #55414 (comment).
Based on my findings, the original approach of sorting schema columns is not the appropriate solution to the problem the original developer was facing.
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.
bert-mccutchen
changed the title
Reverted: Sort table columns by name when dumping schema
Revert: Sort table columns by name when dumping schema
Feb 18, 2026
I agree with reverting the change to sorting the columns when dumping for the following reasons:
What was an occasional issue with a developer's local database not matching the order of the production database is now a issue of every developer's local database not matching each other developer's local database as well as production. To avoid drift between developers' databases they'll need to recreate and reseed them, making migrations effectively a production only feature. This may make sense for AI agentic workflows where you are creating and seeding databases constantly when spinning up agents but it's not great for humans who may be maintaining local data for a feature they're working on and need to merge in the work of other developers.
It breaks workflows where column order is significant such as loading bulk data from CSVs. For example we use PG::Connection#put_copy_data to load data updates from CSVs for both development and production environments and now have to put workarounds in to ensure correct ordering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Background
This Pull Request has been created for the Rails core team to review reverting sorted schema columns.
This is based on the findings outlined in discussion on #55414 (comment).
Based on my findings, the original approach of sorting schema columns is not the appropriate solution to the problem the original developer was facing.
Detail
Additional information
N/A
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]