From b5e6e67212d1d4496892b36d2d976dea2a47df9c Mon Sep 17 00:00:00 2001 From: Montana Date: Thu, 7 Feb 2019 13:24:02 -0500 Subject: [PATCH] Add names to foreign keys on latest migration --- alembic/versions/1f690989e38e_add_pdf_to_task_order.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alembic/versions/1f690989e38e_add_pdf_to_task_order.py b/alembic/versions/1f690989e38e_add_pdf_to_task_order.py index a7d30c9a..c22926da 100644 --- a/alembic/versions/1f690989e38e_add_pdf_to_task_order.py +++ b/alembic/versions/1f690989e38e_add_pdf_to_task_order.py @@ -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')