ash_postgres
ash_postgres copied to clipboard
Constraint migration generations ignore prefixes
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
- Create a resource with a prefix on data layer level. Generate migrations.
- Create a resource that has a foreign key on table from #1. Generate migrations.
- Change the name of table 1. Generate migrations.
- 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"}