gate2: fix duplicate column/index in migrations for fresh DB installation
This commit is contained in:
@@ -15,14 +15,8 @@ depends_on = None
|
||||
|
||||
def upgrade() -> None:
|
||||
# Add missing columns from TimestampMixin and SoftDeleteMixin
|
||||
op.add_column(
|
||||
"notification_preferences",
|
||||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()),
|
||||
)
|
||||
op.add_column(
|
||||
"notification_preferences",
|
||||
sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True),
|
||||
)
|
||||
op.execute("ALTER TABLE notification_preferences ADD COLUMN IF NOT EXISTS created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()")
|
||||
op.execute("ALTER TABLE notification_preferences ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMPTZ")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
|
||||
Reference in New Issue
Block a user