fix: stop prisma from dropping custom tables on every deploy
entrypoint.sh: removed --accept-data-loss from prisma db push. That flag was silently dropping fs_users, fs_projects etc. on every container restart, wiping all user/project data. Made the push non-fatal so a schema mismatch doesn't block startup. create/route.ts: fixed same broken ON CONFLICT expression as authOptions.ts — replaced with explicit SELECT + INSERT/UPDATE to reliably upsert fs_users before inserting the project. Made-with: Cursor
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
set -e
|
||||
|
||||
echo "=== Syncing NextAuth schema ==="
|
||||
npx prisma db push --accept-data-loss --skip-generate
|
||||
# NOTE: Do NOT use --accept-data-loss — it drops tables not in the Prisma schema,
|
||||
# which destroys fs_users, fs_projects etc. Use --skip-generate only.
|
||||
npx prisma db push --skip-generate || echo "Prisma push failed (non-fatal — tables may already be correct)"
|
||||
|
||||
echo "=== Ensuring app tables exist ==="
|
||||
node -e "
|
||||
|
||||
Reference in New Issue
Block a user