mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
Add a missing foreign key constraint that was missed in 40b2c7d988d7_add_reused_module_id_column.py
This commit is contained in:
@@ -16,7 +16,6 @@ import sqlalchemy as sa
|
||||
|
||||
def upgrade():
|
||||
op.add_column('module_builds', sa.Column('reused_module_id', sa.Integer(), nullable=True))
|
||||
sa.ForeignKeyConstraint(['reused_module_id'], ['module_builds.id'], ),
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"""Add the missing foreign key constraint for reused_module_id
|
||||
|
||||
Revision ID: d5188b4a7bf1
|
||||
Revises: 0b00036c540f
|
||||
Create Date: 2019-08-02 13:22:14.257869
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "d5188b4a7bf1"
|
||||
down_revision = "0b00036c540f"
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table("module_builds", schema=None) as batch_op:
|
||||
batch_op.create_foreign_key("reused_module", "module_builds", ["reused_module_id"], ["id"])
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("module_builds", schema=None) as batch_op:
|
||||
batch_op.drop_constraint("reused_module", type_="foreignkey")
|
||||
Reference in New Issue
Block a user