Tables with same name but different schemas seems to break migration generator

In my system, I have two schemas, public and raw. And inside both schemas, I have a table called records.

They have the same name, but they are very different tables

Seems like the resource_snapshots store both tables json file in the same resources directory and that seems to create some conflicts.

For example, I first added the raw.records table and created a migration for it, then, I created the public.records table and its migration.

Now I’m adding an index to the raw.records table, but when I run mix ash_postgres.generate_migrations, Ash will try to recreate the full raw.records table:

create table(:records, primary_key: false, prefix: "raw") do

Is this a bug?

:thinking: yes, that is a bug. If there is an explicit schema configured, it is going to need to be included in the file name. Can you open an issue in ash_postgres? I’ll fix this weekend or Monday.

1 Like

Done tables with same name and different schemas breaks migration generator logic · Issue #193 · ash-project/ash_postgres · GitHub