fix: missing notification entity_type/entity_id migration (0063)

This commit is contained in:
Agent Zero
2026-07-29 12:35:44 +02:00
parent 8dacb739bd
commit e1d522c6a2
@@ -0,0 +1,28 @@
"""Add entity_type and entity_id to notifications table.
Revision ID: 0063
Revises: 0062
Create Date: 2026-07-29
The notification model has entity_type and entity_id fields but the DB
table was never migrated. This causes INSERT failures.
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID
revision = "0063"
down_revision = "0062"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column("notifications", sa.Column("entity_type", sa.String(50), nullable=True, index=True))
op.add_column("notifications", sa.Column("entity_id", UUID(as_uuid=True), nullable=True))
def downgrade() -> None:
op.drop_column("notifications", "entity_id")
op.drop_column("notifications", "entity_type")