From 140f8fe6c7aa7313989df9c0f1c118b7e97b0a6f Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 20 Jul 2016 15:41:33 -0600 Subject: [PATCH] Remove unique constraint on ofxsource.fid Because we have several financial institutions with the same FID value. Yeah. --- .../16ac2bbf8b81_ofxsource_fid_nonunique.py | 24 +++++++++++++++++++ vanth/tables.py | 1 - 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 alembic/versions/16ac2bbf8b81_ofxsource_fid_nonunique.py diff --git a/alembic/versions/16ac2bbf8b81_ofxsource_fid_nonunique.py b/alembic/versions/16ac2bbf8b81_ofxsource_fid_nonunique.py new file mode 100644 index 0000000..8a353c8 --- /dev/null +++ b/alembic/versions/16ac2bbf8b81_ofxsource_fid_nonunique.py @@ -0,0 +1,24 @@ +"""ofxsource_fid_nonunique + +Revision ID: 16ac2bbf8b81 +Revises: 3ec1289eae7a +Create Date: 2016-07-20 15:41:03.117666 + +""" + +# revision identifiers, used by Alembic. +revision = '16ac2bbf8b81' +down_revision = '3ec1289eae7a' +branch_labels = None +depends_on = None + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +def upgrade(): + op.drop_constraint('uq_ofxsource_fid', 'ofxsource', type_='unique') + + +def downgrade(): + op.create_unique_constraint('uq_ofxsource_fid', 'ofxsource', ['fid']) diff --git a/vanth/tables.py b/vanth/tables.py index 728ac0a..339621d 100644 --- a/vanth/tables.py +++ b/vanth/tables.py @@ -48,7 +48,6 @@ OFXSource = table('ofxsource', Column('bankid', String(255), nullable=True), # The bank ID of the institution such as 324377516. # This may be a routing number Column('url', String(4096), nullable=False), # The base URL for the ofxsource - UniqueConstraint('fid', name='uq_ofxsource_fid'), ) OFXAccount = table('ofxaccount',