we're experiencing an issue when using the ArchivableBehavior for tables with indices.
The behavior copies the indices from the original table without modifying the index name.
This leads to multiple indices with same name. At least in PostgreSQL this is not allowed and results in a failing migration:
One of my colleagues introduced a workaround in our project by setting the copied index name to an empty string.
This way a unique index name will be generated.
Hi there,
we're experiencing an issue when using the ArchivableBehavior for tables with indices. The behavior copies the indices from the original table without modifying the index name. This leads to multiple indices with same name. At least in
PostgreSQL
this is not allowed and results in a failing migration:One of my colleagues introduced a workaround in our project by setting the copied index name to an empty string. This way a unique index name will be generated.
Related code: https://github.com/propelorm/Propel2/blame/master/src/Propel/Generator/Behavior/Archivable/ArchivableBehavior.php#L129-L132
Workaround:
I'd like to get rid of our custom workaround for this issue. We should discuss how we can solve this in Propel.
Some ideas:
-archive
(e.g.index-original_table-column
→index-original_table-column-archive
)If we can agree on a solution, I'll try to create a PR for this.