gate2: fix duplicate column/index in migrations for fresh DB installation
This commit is contained in:
@@ -19,8 +19,9 @@ 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))
|
||||
op.execute("ALTER TABLE notifications ADD COLUMN IF NOT EXISTS entity_type VARCHAR(50)")
|
||||
op.execute("CREATE INDEX IF NOT EXISTS ix_notifications_entity_type ON notifications (entity_type)")
|
||||
op.execute("ALTER TABLE notifications ADD COLUMN IF NOT EXISTS entity_id UUID")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
|
||||
Reference in New Issue
Block a user