Browse Source
groups_users and collections_groups were created with UNIQUE constraints instead of PRIMARY KEY in the 2022-07-27 migration. Add a new migration that promotes the unique indexes to primary keys. MySQL auto-names a UNIQUE constraint after its first column, so the index names to drop are 'groups_uuid' and 'collections_uuid' respectively.pull/6997/head
3 changed files with 19 additions and 2 deletions
@ -0,0 +1,7 @@ |
|||
ALTER TABLE groups_users |
|||
DROP PRIMARY KEY, |
|||
ADD UNIQUE (groups_uuid, users_organizations_uuid); |
|||
|
|||
ALTER TABLE collections_groups |
|||
DROP PRIMARY KEY, |
|||
ADD UNIQUE (collections_uuid, groups_uuid); |
|||
@ -0,0 +1,10 @@ |
|||
-- groups_users and collections_groups were created with UNIQUE instead of |
|||
-- PRIMARY KEY. Diesel requires primary keys on all tables for schema |
|||
-- introspection. Drop the auto-named unique index and add the primary key. |
|||
ALTER TABLE groups_users |
|||
DROP INDEX groups_uuid, |
|||
ADD PRIMARY KEY (groups_uuid, users_organizations_uuid); |
|||
|
|||
ALTER TABLE collections_groups |
|||
DROP INDEX collections_uuid, |
|||
ADD PRIMARY KEY (collections_uuid, groups_uuid); |
|||
Loading…
Reference in new issue