fix: Run prisma db push but continue if OOM and DB exists
This commit is contained in:
@@ -9,13 +9,17 @@ echo "Checking database..."
|
|||||||
mkdir -p /app/data
|
mkdir -p /app/data
|
||||||
chmod 777 /app/data
|
chmod 777 /app/data
|
||||||
|
|
||||||
# Only run db push if database file doesn't exist
|
# Run db push (creates/updates database schema)
|
||||||
if [ ! -f /app/data/dev.db ]; then
|
# If it fails due to OOM but DB exists, continue anyway
|
||||||
echo "Database not found, creating..."
|
./node_modules/prisma/build/index.js db push --skip-generate || {
|
||||||
./node_modules/prisma/build/index.js db push --skip-generate
|
exit_code=$?
|
||||||
|
if [ -f /app/data/dev.db ]; then
|
||||||
|
echo "db push failed (code $exit_code) but database exists, continuing..."
|
||||||
else
|
else
|
||||||
echo "Database already exists, skipping db push..."
|
echo "db push failed and database does not exist"
|
||||||
|
exit $exit_code
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo "Starting application..."
|
echo "Starting application..."
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user