mabel/migrations/20230706231224_add-slug-constraint.up.sql
2023-07-07 01:36:48 +02:00

6 lines
206 B
SQL

-- 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;