-- Add NOT NULL and PRIMARY KEY to group_permissions.
-- Requires V63 to have run first (no duplicates can remain).
--
-- After this migration, future seed migrations can use:
--   INSERT INTO group_permissions ... ON CONFLICT DO NOTHING
-- instead of the INSERT ... WHERE NOT EXISTS pattern used before V64.
ALTER TABLE group_permissions
    ALTER COLUMN permission SET NOT NULL;

ALTER TABLE group_permissions
    ADD CONSTRAINT pk_group_permissions PRIMARY KEY (group_id, permission);
