Skip to content

Conversation

@ucguy4u
Copy link

@ucguy4u ucguy4u commented Nov 4, 2025

…a support

The YugabyteDB extension was checking for the existence of yb_flyway_lock_table across ALL schemas using information_schema.columns without filtering by schema. This caused issues when migrating multiple schemas:

  • First schema creates the lock table successfully
  • Subsequent schemas find the table exists (in another schema) and don't create their own
  • When trying to use the lock table, it fails because it's not in the current schema

This fix adds 'AND table_schema = current_schema()' to the LOCK_TABLE_SCHEMA_SQL query, ensuring each schema checks for and creates its own independent lock table.

Fixes #111

…-schema support

The YugabyteDB extension was checking for the existence of yb_flyway_lock_table
across ALL schemas using information_schema.columns without filtering by schema.
This caused issues when migrating multiple schemas:
- First schema creates the lock table successfully
- Subsequent schemas find the table exists (in another schema) and don't create their own
- When trying to use the lock table, it fails because it's not in the current schema

This fix adds 'AND table_schema = current_schema()' to the LOCK_TABLE_SCHEMA_SQL
query, ensuring each schema checks for and creates its own independent lock table.

Fixes flyway#111
@ucguy4u ucguy4u marked this pull request as draft November 4, 2025 11:45
@ucguy4u ucguy4u marked this pull request as ready for review November 4, 2025 11:45
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.

Bug Report: YB_FLYWAY_LOCK_TABLE not created per schema in multi-schema migrations

2 participants