Template
Add 3x-ui user sync via panel API (login or Bearer token).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,5 +78,15 @@ def init_schema():
|
||||
if stmt:
|
||||
cur.execute(stmt)
|
||||
conn.commit()
|
||||
# Soft migrations for existing databases
|
||||
with pool.connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS xui_email TEXT"
|
||||
)
|
||||
cur.execute(
|
||||
"CREATE INDEX IF NOT EXISTS idx_users_xui_email ON users(xui_email)"
|
||||
)
|
||||
conn.commit()
|
||||
_schema_ready = True
|
||||
logger.info('PostgreSQL schema ready')
|
||||
|
||||
Reference in New Issue
Block a user