fix: RLS seeding, FQDN 422, stale migration hash, mail_accounts.password_salt

- Use migration engine (crm_migration, BYPASSRLS) for default data seeding
  in app/main.py instead of crm_api role which is RLS-enforced
- Skip domains PATCH for dockercompose apps in deploy_api() to avoid 422
- Regenerate migration_hashes.txt for 0085_restore_tenant_rls.py
- Add migration 0110: password_salt column to mail_accounts
This commit is contained in:
Agent Zero
2026-08-06 01:28:37 +02:00
parent 5b7d93cd0e
commit 5051ffd40f
4 changed files with 61 additions and 6 deletions
+5 -1
View File
@@ -287,9 +287,13 @@ async def lifespan(app: FastAPI):
logger.info("Field definitions registered for %d active plugins", len(active_plugin_names))
# Seed default data (EUR currency, 19%/7% tax rates) for all tenants
# ⚠️ Use migration engine (crm_migration, BYPASSRLS) — RLS on currencies/taxes
# blocks inserts from crm_api role without tenant context.
from app.core.seeds import seed_default_data
from app.core.db import get_migration_session_factory
async with async_session() as db:
mig_session_factory = get_migration_session_factory()
async with mig_session_factory() as db:
try:
await seed_default_data(db)
await db.commit()