2026.06.04 frontend építés közben

This commit is contained in:
Roo
2026-06-04 07:26:22 +00:00
parent 7adf6cc3e3
commit 59a30ac428
3302 changed files with 24091 additions and 1771 deletions

View File

@@ -0,0 +1,31 @@
import asyncio
from sqlalchemy import text
from app.db.session import AsyncSessionLocal
async def setup_prerequisites():
print("--- Setting up Prerequisites ---")
async with AsyncSessionLocal() as session:
params = [
("auth_remember_me_days", '{"value": 30}'),
("auth_refresh_default_days", '{"value": 1}'),
("auth_password_strict", '{"value": true}')
]
for key, value in params:
# check if exists
res = await session.execute(text("SELECT key FROM system.system_parameters WHERE key = :key"), {"key": key})
if res.scalar():
await session.execute(
text("UPDATE system.system_parameters SET value = CAST(:value AS jsonb) WHERE key = :key"),
{"key": key, "value": value}
)
else:
await session.execute(
text("INSERT INTO system.system_parameters (key, value, is_active) VALUES (:key, CAST(:value AS jsonb), true)"),
{"key": key, "value": value}
)
await session.commit()
print("Prerequisites setup complete.\n")
if __name__ == "__main__":
asyncio.run(setup_prerequisites())