fix(db): cast uuid to text for MIN() in services dedup query (GRO-364)

Postgres has no built-in MIN() aggregate for UUID type.
Cast to text before aggregating, then cast back to uuid.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
groombook-engineer[bot]
2026-04-01 12:25:43 +00:00
parent 63100f07de
commit 034b733f74
+1 -1
View File
@@ -427,7 +427,7 @@ async function seed() {
// Deduplicate existing services (keep lowest id per name) before inserting.
await db.execute(sql`
DELETE FROM services WHERE id NOT IN (
SELECT MIN(id) FROM services GROUP BY name
SELECT (MIN(id::text))::uuid FROM services GROUP BY name
)
`);