You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
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:
To Reproduce
Create two resources (A and B) with the same table name but with distinct schemas.
First generate a migration for the resource A, then to B.
Now try to create an index for the A resource and try to generate a migration for that change.
AshPostgres will add the A resource table creation to the migration file.
Expected behavior
AshPostgres should not be confused by resources that share the same name but distinct schemas.
** Runtime
Elixir version 1.16.0
Erlang version 26.2.1
OS Fedora Silverblue 39
Ash version 2.17
any related extension versions AshPostgres main
The text was updated successfully, but these errors were encountered:
The solution here is to include the prefix in the file name when there is a statically configured prefix on the resource. I will address this early next week, but if anyone wants to take a stab at it before then they are more than welcome. The fix will be in the file name determination logic in migration_generator.ex.
Describe the bug
In my system, I have two schemas,
public
andraw
. And inside both schemas, I have a table calledrecords
.They have the same name, but they are very different tables
Seems like the
resource_snapshots
store both tables json file in the sameresources
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 thepublic.records
table and its migration.Now I'm adding an index to the
raw.records
table, but when I runmix ash_postgres.generate_migrations
, Ash will try to recreate the fullraw.records
table:To Reproduce
Create two resources (A and B) with the same table name but with distinct schemas.
First generate a migration for the resource A, then to B.
Now try to create an index for the A resource and try to generate a migration for that change.
AshPostgres will add the A resource table creation to the migration file.
Expected behavior
AshPostgres should not be confused by resources that share the same name but distinct schemas.
** Runtime
The text was updated successfully, but these errors were encountered: