Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing index renaming when completing a migration (#577)
During testing the faithful duplication of indexed columns I discovered that if a column is included in multiple indices the only one of the indices are renamed. It happened because the index was deleted from the bookkeeper in the table even if the index was not renamed. ``` postgres=# \d items Table "public.items" Column | Type | Collation | Nullable | Default --------+------------------------+-----------+----------+----------------------------------------------- id | integer | | not null | nextval('_pgroll_new_items_id_seq'::regclass) city | character varying(255) | | | name | character varying(255) | | | Indexes: "_pgroll_new_items_pkey" PRIMARY KEY, btree (id) "_pgroll_dup_idx_items_unique_name" UNIQUE, btree (name) "items_unique_name_id" UNIQUE CONSTRAINT, btree (city, name) ``` Correct output after my fix: ``` postgres=# \d items Table "public.items" Column | Type | Collation | Nullable | Default --------+------------------------+-----------+----------+----------------------------------------------- id | integer | | not null | nextval('_pgroll_new_items_id_seq'::regclass) city | character varying(255) | | | name | character varying(255) | | | Indexes: "_pgroll_new_items_pkey" PRIMARY KEY, btree (id) "idx_items_unique_name" UNIQUE, btree (name) "items_unique_name_id" UNIQUE CONSTRAINT, btree (city, name) ```
- Loading branch information