Initial curated projectbrain source from 8a7b1e0651dbdab97d744cbd2e653ab3970ac6c5
This commit is contained in:
commit
5aa3e8d685
700 files changed
+132801
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
LEGACY_INIT_MIGRATION="prisma/migrations/20260606200000_init_project_workspace"
|
||||
if [ -d "$LEGACY_INIT_MIGRATION" ]; then
|
||||
echo "[ProjectBrain] Removing obsolete duplicate init migration: $LEGACY_INIT_MIGRATION"
|
||||
rm -rf "$LEGACY_INIT_MIGRATION"
|
||||
fi
|
||||
|
||||
FAILED_LEGACY_COUNT=$(./node_modules/.bin/prisma migrate status --schema prisma/schema.prisma 2>&1 | grep -c "20260606200000_init_project_workspace" || true)
|
||||
if [ "$FAILED_LEGACY_COUNT" != "0" ]; then
|
||||
echo "[ProjectBrain] Legacy migration 20260606200000_init_project_workspace is recorded in the database."
|
||||
echo "[ProjectBrain] Marking it as rolled back so migrate deploy can continue with the corrected migration chain."
|
||||
./node_modules/.bin/prisma migrate resolve --rolled-back 20260606200000_init_project_workspace --schema prisma/schema.prisma || true
|
||||
fi
|
||||
|
||||
echo "[ProjectBrain] Running Prisma migrations..."
|
||||
./node_modules/.bin/prisma migrate deploy --schema prisma/schema.prisma
|
||||
|
||||
if [ "${PROJECTBRAIN_SEED_ON_START:-false}" = "true" ]; then
|
||||
echo "[ProjectBrain] Seeding database..."
|
||||
./node_modules/.bin/tsx prisma/seed.ts
|
||||
else
|
||||
echo "[ProjectBrain] Skipping database seed. Set PROJECTBRAIN_SEED_ON_START=true to seed fixtures."
|
||||
fi
|
||||
|
||||
echo "[ProjectBrain] Starting API..."
|
||||
exec node dist/server.js
|
||||
Reference in new issue
Block a user