-
-
Notifications
You must be signed in to change notification settings - Fork 301
Description
Migrated issue, originally created by Kuan Butts (@kuanb)
Problem:
Alembic is generating long index names, Postgres is automatically shortening them when they are created, resulting in a situation where Alembic "loses track" of that index. Subsequent revisions will generate a new migration that involves dropping the index Postgres created and attempting to re-insert the original index name (which then gets shortened again, starting the loop over once again).
Here's an example name it's generating:
ix_analysis_module_public_results_new_user_summary_module_run_output
...and here is what it would be altered to by Postgres (due to max character length constraint):
ix_analysis_module_public_results_new_user_summary_mod_4597
It would be useful to either have Alembic check that such a change occurred and track it itself or to allow the user to provide a lookup table that equates a shortened name to a longer name, thus enabling it to connect the two when making new migrations.