mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 20:29:53 +08:00
Add a migration that adds a missing uniqueness constraint that was defined in the model
The uniqueness constraint was added in 599c881714, but it
was not part of the migration.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Add a missing uniqueness constraint to module_builds_to_module_buildrequires
|
||||
|
||||
Revision ID: 65ad4fcdbce6
|
||||
Revises: 6d503efcd2b8
|
||||
Create Date: 2019-04-30 19:56:38.447195
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '65ad4fcdbce6'
|
||||
down_revision = '6d503efcd2b8'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table('module_builds_to_module_buildrequires') as b:
|
||||
b.create_unique_constraint('unique_buildrequires', ['module_id', 'module_buildrequire_id'])
|
||||
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table('module_builds_to_module_buildrequires') as b:
|
||||
b.drop_constraint('unique_buildrequires', type_='unique')
|
||||
Reference in New Issue
Block a user