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:
@@ -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
|
||||
)
|
||||
`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user