SQL and Seed into App
Docker Image bauen und veroeffentlichen / build-and-push (push) Successful in 3m14s

This commit is contained in:
Nick Szaunig committed 2026-08-19 07:27:27 +02:00
1 parent 8587265155
commit 68781589d8
2 files changed
+234

No files matched your search

@@ -0,0 +1,22 @@
-- Schema/Migrations-Drift beheben: "images"/"tasteTags" wurden in
-- schema.prisma von String[] auf Json umgestellt (MySQL kennt keine nativen
-- Skalar-Arrays), die urspruengliche Init-Migration hat die Spalten aber nie
-- entsprechend geaendert — sie blieben TEXT[]. "prisma migrate deploy"
-- validiert nicht gegen das Schema, daher blieb das unbemerkt bis zum ersten
-- echten Seed-Lauf ("malformed array literal" beim Insert eines JSON-Werts
-- in eine TEXT[]-Spalte). to_jsonb() wandelt bestehende TEXT[]-Werte 1:1 in
-- ein JSON-Array um.
ALTER TABLE "harvests"
ALTER COLUMN "images" DROP DEFAULT,
ALTER COLUMN "images" TYPE JSONB USING to_jsonb("images"),
ALTER COLUMN "images" SET DEFAULT '[]'::jsonb;
ALTER TABLE "products"
ALTER COLUMN "tasteTags" DROP DEFAULT,
ALTER COLUMN "tasteTags" TYPE JSONB USING to_jsonb("tasteTags"),
ALTER COLUMN "tasteTags" SET DEFAULT '[]'::jsonb;
ALTER TABLE "products"
ALTER COLUMN "images" DROP DEFAULT,
ALTER COLUMN "images" TYPE JSONB USING to_jsonb("images"),
ALTER COLUMN "images" SET DEFAULT '[]'::jsonb;