mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-23 06:11:58 +00:00
feat: migrate from PostgreSQL to SQLite
- Updated Docker Compose and Dockerfile to remove PostgreSQL dependencies and configure SQLite as the database provider. - Adjusted environment variables and healthcheck commands to reflect the new database setup. - Simplified server startup script by removing PostgreSQL wait logic and replacing migration commands with schema push. - Updated Prisma schema to use SQLite and removed related migration files.
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Starting Palmr Server..."
|
||||
echo "Starting Palmr Server with SQLite..."
|
||||
|
||||
# Set proper environment
|
||||
export HOME=/home/palmr
|
||||
export NPM_CONFIG_CACHE=/home/palmr/.npm
|
||||
export PNPM_HOME=/home/palmr/.pnpm
|
||||
|
||||
# Wait for PostgreSQL - use environment variable or default to postgres
|
||||
DB_HOST=${DB_HOST:-postgres}
|
||||
DB_PORT=${DB_PORT:-5432}
|
||||
echo "Waiting for PostgreSQL at $DB_HOST:$DB_PORT..."
|
||||
while ! nc -z $DB_HOST $DB_PORT; do
|
||||
sleep 1
|
||||
done
|
||||
echo "PostgreSQL is up!"
|
||||
|
||||
cd /app/server
|
||||
|
||||
echo "Generating Prisma client..."
|
||||
npx prisma generate --schema=./prisma/schema.prisma
|
||||
|
||||
echo "Running migrations..."
|
||||
npx prisma migrate deploy
|
||||
echo "Pushing database schema..."
|
||||
npx prisma db push --accept-data-loss
|
||||
|
||||
echo "Running database seeds..."
|
||||
node prisma/seed.js || echo "Seeds failed or already exist, continuing..."
|
||||
|
Reference in New Issue
Block a user