Skip to content

Conversation

miketheman
Copy link
Member

Follows #13929

Some changes that were not observed during dev/test:

Signed-off-by: Mike Fiedler miketheman@gmail.com

Some changes that were not observed during dev/test:

- raw SQL now needs to be wrapped in `text()`
- if using an existing Connection, it doesn't have a `connnect()`
  method, so we configure the existing context to use it.
  Follows pattern from Alembic Cookbook
  https://alembic.sqlalchemy.org/en/latest/cookbook.html#sharing-a-connection-across-one-or-more-programmatic-migration-commands

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
The response from `text()` calls is now slightly harder to compare.

Consolidates comparison logic for all tests in module.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman requested a review from a team as a code owner June 15, 2023 13:55
)
)
conn.execute("COMMIT")
conn.execute(sa.text("COMMIT"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This surfaced during a make initdb vs running migrations. I chose to preserve the text vs conn.commit() since the function has other semantics applicable to the running connection.

@miketheman miketheman enabled auto-merge (squash) June 15, 2023 14:26
@miketheman miketheman disabled auto-merge June 15, 2023 14:26
@ewdurbin ewdurbin merged commit a50bcac into pypi:main Jun 15, 2023
@miketheman miketheman deleted the miketheman/fix-migrations branch June 15, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants