Add names to foreign keys on latest migration
This commit is contained in:
parent
eaa5c93922
commit
b5e6e67212
@ -21,15 +21,15 @@ def upgrade():
|
||||
op.add_column('task_orders', sa.Column('pdf_attachment_id', postgresql.UUID(as_uuid=True), nullable=True))
|
||||
op.drop_constraint('task_orders_attachments_attachment_id', 'task_orders', type_='foreignkey')
|
||||
op.alter_column('task_orders', 'attachment_id', new_column_name='csp_attachment_id')
|
||||
op.create_foreign_key(None, 'task_orders', 'attachments', ['pdf_attachment_id'], ['id'])
|
||||
op.create_foreign_key(None, 'task_orders', 'attachments', ['csp_attachment_id'], ['id'])
|
||||
op.create_foreign_key('task_orders_attachments_pdf_attachment_id', 'task_orders', 'attachments', ['pdf_attachment_id'], ['id'])
|
||||
op.create_foreign_key('task_orders_attachments_csp_attachment_id', 'task_orders', 'attachments', ['csp_attachment_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'task_orders', type_='foreignkey')
|
||||
op.drop_constraint(None, 'task_orders', type_='foreignkey')
|
||||
op.drop_constraint('task_orders_attachments_csp_attachment_id', 'task_orders', type_='foreignkey')
|
||||
op.drop_constraint('task_orders_attachments_pdf_attachment_id', 'task_orders', type_='foreignkey')
|
||||
op.alter_column('task_orders', 'csp_attachment_id', new_column_name='attachment_id')
|
||||
op.create_foreign_key('task_orders_attachments_attachment_id', 'task_orders', 'attachments', ['attachment_id'], ['id'])
|
||||
op.drop_column('task_orders', 'pdf_attachment_id')
|
||||
|
Loading…
x
Reference in New Issue
Block a user