Skip to content

Fix concurrent index migrations with schema-driven multitenancy #610#685

Open
RylandBangerter85 wants to merge 1 commit intoash-project:mainfrom
RylandBangerter85:fix-concurrent-index-multitenancy
Open

Fix concurrent index migrations with schema-driven multitenancy #610#685
RylandBangerter85 wants to merge 1 commit intoash-project:mainfrom
RylandBangerter85:fix-concurrent-index-multitenancy

Conversation

@RylandBangerter85
Copy link

@RylandBangerter85 RylandBangerter85 commented Feb 4, 2026

  • Detect migrations with @disable_ddl_transaction attribute
  • Run concurrent index migrations outside transaction context
  • Use Ecto.Adapters.SQL.checkout to get fresh connection
  • Add comprehensive test suite for concurrent index scenarios
  • Maintain backward compatibility with regular migrations

Fixes issue where CREATE INDEX CONCURRENTLY fails when creating tenants

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

- Detect migrations with @disable_ddl_transaction attribute
- Run concurrent index migrations outside transaction context
- Use Ecto.Adapters.SQL.checkout to get fresh connection
- Add comprehensive test suite for concurrent index scenarios
- Maintain backward compatibility with regular migrations

Fixes issue where CREATE INDEX CONCURRENTLY fails when creating tenants
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.

1 participant