fix: resolve database migration failures and startup ordering
- Add scripts/run-migrations.js to run migrations before data loading - Fix startup.sh ordering: migrations -> data load -> app start - Fix migration 0005 missing statement-breakpoint between ALTER TABLE statements - Add migration 0005 to drizzle journal (was missing) - Fix load-initial-data.js to check table existence before querying - Fix load-initial-data.js to create chart record before inserting candles (chart_id NOT NULL constraint) - Simplify db/index.ts migration error handling (remove overly broad 'already exists' catch) - Add pre-migration check for inconsistent DB state (tables without migration tracking)
This commit is contained in:
parent
573efea5b5
commit
2bde38d0bf
6 changed files with 87 additions and 17 deletions
|
|
@ -2,7 +2,7 @@
|
|||
set -e
|
||||
|
||||
echo "Running database migrations..."
|
||||
# Migrations are run automatically by the app on startup
|
||||
node /app/scripts/run-migrations.js
|
||||
|
||||
echo "Loading initial data if needed..."
|
||||
node /app/scripts/load-initial-data.js
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue