gate2: fix duplicate column/index in migrations for fresh DB installation
This commit is contained in:
@@ -31,10 +31,7 @@ def upgrade():
|
||||
op.create_index("ix_contact_folders_user", "contact_folders", ["user_id"])
|
||||
|
||||
# 2. Add folder_id column to contacts
|
||||
op.add_column(
|
||||
"contacts",
|
||||
sa.Column("folder_id", UUID(as_uuid=True), sa.ForeignKey("contact_folders.id", ondelete="SET NULL"), nullable=True),
|
||||
)
|
||||
op.execute("ALTER TABLE contacts ADD COLUMN IF NOT EXISTS folder_id UUID REFERENCES contact_folders(id) ON DELETE SET NULL")
|
||||
op.create_index("ix_contacts_folder_id", "contacts", ["folder_id"])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user