Skip to content

Conversation

wil93
Copy link
Member

@wil93 wil93 commented Jun 19, 2025

No description provided.

@wil93 wil93 mentioned this pull request Jun 19, 2025
@wil93 wil93 force-pushed the check-sql-diff branch 4 times, most recently from c2588fa to 5325cee Compare June 19, 2025 23:39
@wil93
Copy link
Member Author

wil93 commented Jun 19, 2025

It doesn't seem to work very well because pg_dump's output is not very stable :(

image

Probably we should use something like:

@prandla
Copy link
Member

prandla commented Jun 20, 2025

order of columns is a genuine property of the schema. i'm not sure if it matters when using sqlalchemy but it does matter when doing e.g. select * from a table in the psql console. unfortunately it seems that reordering columns is not something that postgresql explicitly supports. so to get the order to match up, we would need to either always add new fields at the end of a table, or do some pretty horrible hacks in the migration script (dropping and recreating columns, and then fixing up all foreign keys) to get the columns in the right order.

@gollux
Copy link
Contributor

gollux commented Jun 21, 2025

Maintaining consistent order of columns is too hard and removing ENUM values is plain impossible. So if we want an automated check of schema migration scripts, it must take this things into account.

@veluca93 veluca93 deleted the branch cms-dev:main June 24, 2025 14:16
@veluca93 veluca93 closed this Jun 24, 2025
@veluca93
Copy link
Contributor

Please re-open when a more working version is ready

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

Successfully merging this pull request may close these issues.

4 participants