Files
leocrm/alembic/versions/0020_notifications_updated_at.py
T
Agent Zero 1701361e92 fix(mail): add notifications updated_at migration + attachment sync fix
- Migration 0020: Add updated_at column to notifications table (was missing, causing sync failures)
- IMAP sync now saves attachments for existing emails (retroactive attachment saving)
- Replace silent exception with logger.warning for attachment save failures
- Sync verified: 37 attachments now stored in database (was 0 before)
2026-07-16 23:15:12 +02:00

31 lines
557 B
Python

"""Add updated_at column to notifications table.
Revision ID: 0020
Revises: 0019
Create Date: 2026-07-16
"""
from alembic import op
import sqlalchemy as sa
revision = "0020"
down_revision = "0019"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column(
"notifications",
sa.Column(
"updated_at",
sa.DateTime(timezone=True),
nullable=False,
server_default=sa.func.now(),
),
)
def downgrade() -> None:
op.drop_column("notifications", "updated_at")