Поправили заполлнение БД + поправили гонку сообщений при отправке в Битрикс

This commit is contained in:
mi
2026-07-17 11:46:12 +03:00
parent 7457bc5c0b
commit d1a0f3791d
13 changed files with 562 additions and 84 deletions
@@ -0,0 +1,33 @@
"""Store consent device snapshots and remove audit IP.
Revision ID: 0003_consent_audit
Revises: 0002_pgcrypto_digest
Create Date: 2026-07-16
"""
from collections.abc import Sequence
from alembic import op
revision: str = "0003_consent_audit"
down_revision: str | None = "0002_pgcrypto_digest"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
op.execute(
"""
ALTER TABLE han_app.user_consents
ADD COLUMN IF NOT EXISTS device_json jsonb NOT NULL DEFAULT '{}'::jsonb
"""
)
op.execute(
"""
ALTER TABLE han_app.audit_events
DROP COLUMN IF EXISTS ip
"""
)
def downgrade() -> None:
raise RuntimeError("Consent and audit context migration is forward-only")