Code of Conduct
AI Policy
Versions
- Elixir: 1.19.5
- Erlang/OTP: 28
- ash_postgres: main
- ash: main
- ash_sql: main
Operating system
macOS
Current Behavior
When mix ash_postgres.generate_migrations <name> produces multiple migration files in a single run, the generated files can reuse the same explicit migration name suffix and the same migration module name.
For example, with name: "repro_case" and a split migration caused by concurrently: true, the generated files were:
20260320063017_repro_case.exs
20260320063018_repro_case.exs
Both files defined the same module:
AshPostgres.TestRepo.Migrations.ReproCase
As a result, mix ecto.migrate fails because the migration name/module is duplicated.
Reproduction
A minimal reproduction is:
- Define a resource with a concurrent custom index.
- Run:
mix ash_postgres.generate_migrations repro_case --concurrent-indexes
- Observe that two migration files are generated.
- Inspect the generated files and note that both reuse the same explicit name suffix and the same migration module name.
In my case, the generated files were:
20260320063017_repro_case.exs
20260320063018_repro_case.exs
Both files defined:
AshPostgres.TestRepo.Migrations.ReproCase
A standalone repro project is also available here: https://github.com/jechol/ash-postgres-concurrent-indexes-repro
I also opened a repro test PR against ash_postgres here: #724
Expected Behavior
If a single generate_migrations run produces multiple migration files, each generated migration should have a unique derived file name and a unique module name, even when an explicit name is provided.
One possible approach would be to treat the provided name as a base name and append a suffix such as _1, _2, etc.
Code of Conduct
AI Policy
Versions
Operating system
macOS
Current Behavior
When
mix ash_postgres.generate_migrations <name>produces multiple migration files in a single run, the generated files can reuse the same explicit migration name suffix and the same migration module name.For example, with
name: "repro_case"and a split migration caused byconcurrently: true, the generated files were:20260320063017_repro_case.exs20260320063018_repro_case.exsBoth files defined the same module:
AshPostgres.TestRepo.Migrations.ReproCaseAs a result,
mix ecto.migratefails because the migration name/module is duplicated.Reproduction
A minimal reproduction is:
mix ash_postgres.generate_migrations repro_case --concurrent-indexesIn my case, the generated files were:
20260320063017_repro_case.exs20260320063018_repro_case.exsBoth files defined:
AshPostgres.TestRepo.Migrations.ReproCaseA standalone repro project is also available here: https://github.com/jechol/ash-postgres-concurrent-indexes-repro
I also opened a repro test PR against ash_postgres here: #724
Expected Behavior
If a single
generate_migrationsrun produces multiple migration files, each generated migration should have a unique derived file name and a unique module name, even when an explicitnameis provided.One possible approach would be to treat the provided name as a base name and append a suffix such as
_1,_2, etc.