mabel/migrations/20230713114832_add-collection-constraint.up.sql

8 lines
242 B
MySQL
Raw Normal View History

2023-07-13 12:08:26 +00:00
-- Add index/constraint on site and collection slug
CREATE UNIQUE INDEX collections_site_slug_idx
ON collections (site, slug);
ALTER TABLE collections
ADD CONSTRAINT collections_site_slug_unique UNIQUE
USING INDEX collections_site_slug_idx;