ash_postgres icon indicating copy to clipboard operation
ash_postgres copied to clipboard

Constraint migration generations ignore prefixes

Open cschmatzler opened this issue 1 year ago • 0 comments
trafficstars

Describe the bug The AlterDeferrability operation does not respect schema prefixes, which results in broken migrations. https://github.com/ash-project/ash_postgres/blob/459d853d28ffb03085632670a16213abce6842f5/lib/migration_generator/operation.ex#L429

To Reproduce

  1. Create a resource with a prefix on data layer level. Generate migrations.
  2. Create a resource that has a foreign key on table from #1. Generate migrations.
  3. Change the name of table 1. Generate migrations.
  4. The migration fails with "relation does not exist" because the prefix is missing.

Expected behavior Prefix is added to the migration.

** Runtime

  • Elixir version 1.16.2
  • Erlang version 26.2.4
  • OS macOS 14.4.1
  • Ash version {:ash_postgres, "== 2.0.0-rc.15"}

cschmatzler avatar May 06 '24 14:05 cschmatzler