Skip to content

Commit

Permalink
WCM-291: Normalize column order for schema comparison test
Browse files Browse the repository at this point in the history
  • Loading branch information
wosc committed Sep 26, 2024
1 parent e6ca8a3 commit b6e21d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/zeit/connector/tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def _dump(sql, *args, **kw):
# for example `USING gin (mycolumn jsonb_path_ops)`
metadata.reflect(connection)

# We don't care about column order here. (sqlalchemy sorts them in
# python source declaration order, but migrations sort them in
# chronological add order, since postgres can only append columns).
for table in metadata.tables.values():
table.columns._collection.sort() # XXX internal API, might break.

result = []
engine = sqlalchemy.create_mock_engine(
'postgresql://',
Expand Down

0 comments on commit b6e21d2

Please sign in to comment.