new changes
This commit is contained in:
Binary file not shown.
@@ -107,6 +107,16 @@ def _run_migrations(conn):
|
||||
"ALTER TABLE sites ADD COLUMN force_https INTEGER DEFAULT 0"
|
||||
)
|
||||
)
|
||||
if "proxy_upstream" not in cols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE sites ADD COLUMN proxy_upstream VARCHAR(512) DEFAULT ''"))
|
||||
if "proxy_websocket" not in cols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE sites ADD COLUMN proxy_websocket INTEGER DEFAULT 0"))
|
||||
if "dir_auth_path" not in cols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE sites ADD COLUMN dir_auth_path VARCHAR(256) DEFAULT ''"))
|
||||
if "dir_auth_user_file" not in cols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE sites ADD COLUMN dir_auth_user_file VARCHAR(512) DEFAULT ''"))
|
||||
if "php_deny_execute" not in cols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE sites ADD COLUMN php_deny_execute INTEGER DEFAULT 0"))
|
||||
except Exception:
|
||||
pass
|
||||
# Create backup_plans if not exists (create_all handles new installs)
|
||||
@@ -123,6 +133,18 @@ def _run_migrations(conn):
|
||||
"""))
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
r = conn.execute(sqlalchemy.text("PRAGMA table_info(backup_plans)"))
|
||||
bcols = [row[1] for row in r.fetchall()]
|
||||
if bcols:
|
||||
if "s3_bucket" not in bcols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE backup_plans ADD COLUMN s3_bucket VARCHAR(256) DEFAULT ''"))
|
||||
if "s3_endpoint" not in bcols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE backup_plans ADD COLUMN s3_endpoint VARCHAR(512) DEFAULT ''"))
|
||||
if "s3_key_prefix" not in bcols:
|
||||
conn.execute(sqlalchemy.text("ALTER TABLE backup_plans ADD COLUMN s3_key_prefix VARCHAR(256) DEFAULT ''"))
|
||||
except Exception:
|
||||
pass
|
||||
# Create custom_plugins if not exists
|
||||
try:
|
||||
conn.execute(sqlalchemy.text("""
|
||||
|
||||
Reference in New Issue
Block a user