mabel/migrations/20230706231224_add-slug-constraint.up.sql

7 lines
206 B
MySQL
Raw Normal View History

2023-07-06 23:36:48 +00:00
-- Add index/constraint on page site and slug
CREATE UNIQUE INDEX pages_site_slug_idx
ON pages (site, slug);
ALTER TABLE pages
ADD CONSTRAINT pages_site_slug_unique UNIQUE USING INDEX pages_site_slug_idx;