Move working documents to its own area, rename dashboard

This commit is contained in:
2026-04-29 01:21:16 +12:00
parent 7e9663fa06
commit 761ebb050d
32 changed files with 1779 additions and 526 deletions
+30
View File
@@ -9,6 +9,8 @@ from sqlalchemy.engine import Engine
TENANT_TABLES = {
"client_users": None,
"client_feature_access": None,
"client_user_module_permissions": None,
"client_access_audit_events": None,
"raw_materials": None,
"raw_material_price_versions": None,
"mixes": None,
@@ -123,6 +125,34 @@ def sync_tenant_ids(engine: Engine) -> dict[str, int]:
"""
),
),
(
"client_user_module_permissions",
text(
"""
UPDATE client_user_module_permissions
SET tenant_id = (
SELECT client_users.tenant_id
FROM client_users
WHERE client_users.id = client_user_module_permissions.client_user_id
)
WHERE tenant_id IS NULL OR tenant_id = '' OR tenant_id = 'default'
"""
),
),
(
"client_access_audit_events",
text(
"""
UPDATE client_access_audit_events
SET tenant_id = (
SELECT client_accounts.tenant_id
FROM client_accounts
WHERE client_accounts.id = client_access_audit_events.client_account_id
)
WHERE tenant_id IS NULL OR tenant_id = '' OR tenant_id = 'default'
"""
),
),
(
"raw_materials",
text(