Fix null bu_teams in postgres migration, add retry logic to deploy script
This commit is contained in:
@@ -88,7 +88,16 @@ echo "✓ Dependencies installed"
|
||||
echo ""
|
||||
echo "── Step 5: Running data migration (SQLite → Postgres) ──"
|
||||
if [ -f backend/cve_database.db ]; then
|
||||
node backend/scripts/migrate-to-postgres.js
|
||||
if ! node backend/scripts/migrate-to-postgres.js; then
|
||||
echo ""
|
||||
echo "⚠ Migration failed — resetting database and retrying..."
|
||||
PGPASSWORD=sV4xmC9xAUCFop0ypxMVS056QgPqGrX psql -h localhost -p 5433 -U steam -d cve_dashboard -c "
|
||||
DROP SCHEMA public CASCADE;
|
||||
CREATE SCHEMA public;
|
||||
" >/dev/null 2>&1
|
||||
echo "✓ Schema reset"
|
||||
node backend/scripts/migrate-to-postgres.js
|
||||
fi
|
||||
else
|
||||
echo "⚠ No SQLite database found — skipping migration (fresh install)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user