Changeset cc841a5 for docker-entrypoint.sh
- Timestamp:
- 12/27/25 20:00:37 (7 months ago)
- Branches:
- main
- Children:
- 9137793
- Parents:
- 05361b8
- File:
-
- 1 edited
-
docker-entrypoint.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
docker-entrypoint.sh
r05361b8 rcc841a5 8 8 done 9 9 10 echo " Generating migrations..."11 npm run drizzle:generate 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") 12 12 13 echo "Running migrations..." 14 npm run drizzle:migrate 13 if [ "$TABLE_COUNT" -eq "0" ]; then 14 echo "Database is empty, running migrations..." 15 npm run drizzle:generate 16 npm run drizzle:migrate 15 17 16 echo "Seeding database..." 17 npm run drizzle:seed 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 18 23 19 24 echo "Starting application..."
Note:
See TracChangeset
for help on using the changeset viewer.
