Skip to content

Reexamine migration table detection/creation #3407

@roji

Description

@roji

In order to fix #2878 for 9.0, #3294 changed our migration history table creation strategy - we try to select from it without pre-checking whether it exists, and catch "table doesn't exist" exceptions, at which point we create it.

This unfortunately doesn't work if the migration process is wrapped in a user transaction - the error causes the transaction to go into a failed state, and everything breaks down. In addition, this (currently) causes an error to appear in the logs, confusing users and making them think the migration failed. Reexamine our strategy here.

The relevant tasks are MigrationsInfrastructureNpgsqlTest.{Can_apply_two_migrations_in_transaction,Can_apply_two_migrations_in_transaction_async}.

Note: the fix may need to be backported.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions