Changeset 9137793
- Timestamp:
- 12/27/25 20:14:14 (7 months ago)
- Branches:
- main
- Children:
- 9e9293a
- Parents:
- cc841a5
- Files:
-
- 3 added
- 1 edited
-
database/migrations/0000_fancy_mojo.sql (added)
-
database/migrations/meta/0000_snapshot.json (added)
-
database/migrations/meta/_journal.json (added)
-
docker-entrypoint.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
docker-entrypoint.sh
rcc841a5 r9137793 8 8 done 9 9 10 echo "Checking if database needs migration..." 11 TABLE_COUNT=$(psql -h db -U app -d postgres -t -c "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public';" 2>/dev/null || echo "0") 10 echo "Checking if database is initialized..." 12 11 13 if [ "$TABLE_COUNT" -eq "0" ]; then 14 echo "Database is empty, running migrations..." 15 npm run drizzle:generate 16 npm run drizzle:migrate 12 npm run drizzle:migrate 17 13 18 echo "Seeding database..." 19 npm run drizzle:seed 20 else 21 echo "Database already initialized (found $TABLE_COUNT tables), skipping migrations and seed" 22 fi 14 echo "Checking if database needs seeding..." 15 npm run drizzle:seed 23 16 24 17 echo "Starting application..."
Note:
See TracChangeset
for help on using the changeset viewer.
