Fix init-only mode for PostgreSQL deploy script imports.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:14:43 +08:00
parent a1f22624de
commit 008f042fcc
2 changed files with 17 additions and 16 deletions
+2 -1
View File
@@ -79,8 +79,9 @@ echo "==> 初始化 PostgreSQL 表结构..."
cd "$APP_DIR"
export DATABASE_URL
export QIHUO_SKIP_INIT_DB=1
export QIHUO_INIT_ONLY=1
python3 -c "from app import init_db; init_db(); from db_conn import database_label; print('OK:', database_label())"
unset QIHUO_SKIP_INIT_DB
unset QIHUO_SKIP_INIT_DB QIHUO_INIT_ONLY
if [ "$MIGRATE_SQLITE" = "1" ] && [ -f "$APP_DIR/futures.db" ]; then
echo "==> 从 SQLite 迁移数据..."