Skip to content

Add repro test for concurrent index ordering with dependent foreign keys#722

Merged
zachdaniel merged 1 commit intoash-project:mainfrom
jechol:ash_postgres-bug-fix
Mar 20, 2026
Merged

Add repro test for concurrent index ordering with dependent foreign keys#722
zachdaniel merged 1 commit intoash-project:mainfrom
jechol:ash_postgres-bug-fix

Conversation

@jechol
Copy link
Contributor

@jechol jechol commented Mar 20, 2026

Adds a failing regression test for a migration ordering issue with concurrent_indexes: true.

The repro covers a resource with a non-primary-key identity on :code and another resource with a belongs_to that references that identity via destination_attribute(:code).

The generated migrations place the foreign key migration before the concurrent unique index migration, even though the referenced column needs the unique index before the foreign key can be added.

A standalone repro project is available at:
https://github.com/jechol/ash-postgres-concurrent-indexes-repro

This PR is intended as a minimal repro only.

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

@zachdaniel zachdaniel merged commit b607d68 into ash-project:main Mar 20, 2026
64 of 67 checks passed
@jechol jechol deleted the ash_postgres-bug-fix branch March 22, 2026 12:16
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