|
|
@@ -23,6 +23,13 @@ bash build_frontend.sh
|
|
|
echo "updating backend..."
|
|
|
./backend/venv/bin/pip install -r backend/requirements.txt
|
|
|
echo "running database migrations..."
|
|
|
+# Create backup before migrating
|
|
|
+mkdir -p backups
|
|
|
+echo "Backing up database to backups/ folder..."
|
|
|
+# If you use a .env file for DB credentials, source it here:
|
|
|
+# [ -f .env ] && export $(grep -v '^#' .env | xargs)
|
|
|
+mysqldump --no-tablespaces -h ${DB_HOST:-localhost} -u ${DB_USER:-radionica} -p${DB_PASS:-NY9B9VLifDC9ehZ} ${DB_NAME:-radionica3d} > backups/db_pre_migration_$(date +%Y%m%d_%H%M%S).sql
|
|
|
+
|
|
|
./backend/venv/bin/python3 backend/run_migrations.py
|
|
|
|
|
|
# 4. Перезапуск
|