From e94644548e7ccf1da012a7113ac54b46058321c6 Mon Sep 17 00:00:00 2001 From: kevin-asprec Date: Wed, 15 Apr 2026 11:36:45 +0800 Subject: [PATCH] chore: add schema fix script for deployment --- fix-schema.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 fix-schema.js diff --git a/fix-schema.js b/fix-schema.js new file mode 100644 index 0000000..18529d9 --- /dev/null +++ b/fix-schema.js @@ -0,0 +1,5 @@ +const { PrismaClient } = require("@prisma/client"); +const p = new PrismaClient(); +p.$executeRawUnsafe("ALTER TABLE users ALTER COLUMN \"tenantId\" DROP NOT NULL") + .then(() => { console.log("tenantId nullable OK"); return p.$disconnect(); }) + .catch(e => { console.log("Error:", e.message.substring(0, 100)); return p.$disconnect(); });