1855b374b5
Phase 2 extraction: groombook/api from groombook/app monorepo. Changes: - Move packages/db content to apps/api/src/db/ - Move packages/types content to apps/api/src/types/ - Inline database schema and migrations into api package - Update Dockerfile to build single package - Update CI workflow for single-package structure - Fix vitest.config.ts aliases Co-Authored-By: Paperclip <noreply@paperclip.ing>
7 lines
315 B
SQL
7 lines
315 B
SQL
-- Clean up existing duplicate services before adding unique constraint.
|
|
-- Keep the row with the lowest id per name; delete all others.
|
|
DELETE FROM services WHERE id NOT IN (
|
|
SELECT (MIN(id::text))::uuid FROM services GROUP BY name
|
|
);
|
|
|
|
ALTER TABLE "services" ADD CONSTRAINT "services_name_unique" UNIQUE("name"); |