Harden PostgreSQL deploy: auto-rollback on SQL errors, clean DB on migrate.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:13:51 +08:00
parent bc79ad308c
commit a1f22624de
3 changed files with 19 additions and 3 deletions
+3 -2
View File
@@ -534,8 +534,9 @@ def sync_admin_from_env():
set_setting("admin_password_hash", generate_password_hash(env_password))
init_db()
app.logger.info("数据库: %s", database_label())
if os.getenv("QIHUO_SKIP_INIT_DB") != "1":
init_db()
app.logger.info("数据库: %s", database_label())
def sync_ths_token():