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:
@@ -0,0 +1,39 @@
|
||||
"""Add password_salt column to mail_accounts.
|
||||
|
||||
⚠️ KI / AGENT HINWEIS — BITTE VOR ÄNDERUNGEN LESEN ⚠️
|
||||
|
||||
Das ORM-Model MailAccount (app/plugins/builtins/mail/models.py) referenziert
|
||||
die Spalte `password_salt` (String(64), nullable=False, default="").
|
||||
In der Produktions-DB fehlt diese Spalte, was zu SQLAlchemy-Fehlern führt
|
||||
beim Lesen oder Schreiben von MailAccount-Datensätzen.
|
||||
|
||||
Diese Migration fügt die Spalte mit ADD COLUMN IF NOT EXISTS hinzu, sodass
|
||||
bestehende Datensätze den Default-Wert "" (leerer String) erhalten.
|
||||
|
||||
Revision ID: 0110
|
||||
Revises: 0109
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "0110"
|
||||
down_revision = "0109"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.execute(
|
||||
"ALTER TABLE mail_accounts "
|
||||
"ADD COLUMN IF NOT EXISTS password_salt VARCHAR(64) NOT NULL DEFAULT ''"
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.execute(
|
||||
"ALTER TABLE mail_accounts "
|
||||
"DROP COLUMN IF EXISTS password_salt"
|
||||
)
|
||||
Reference in New Issue
Block a user