From ae6b613ecb6520137917fd204f28ff88beae9978 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 20 Jul 2016 15:37:03 -0600 Subject: [PATCH] Make fid nullable I'm not totally sure what we do with sources with no FID, but we are getting it from OFXHome so I'm going to keep it --- .../3ec1289eae7a_ofxaccount_fid_nullable.py | 28 +++++++++++++++++++ vanth/tables.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 alembic/versions/3ec1289eae7a_ofxaccount_fid_nullable.py diff --git a/alembic/versions/3ec1289eae7a_ofxaccount_fid_nullable.py b/alembic/versions/3ec1289eae7a_ofxaccount_fid_nullable.py new file mode 100644 index 0000000..5d7763c --- /dev/null +++ b/alembic/versions/3ec1289eae7a_ofxaccount_fid_nullable.py @@ -0,0 +1,28 @@ +"""ofxaccount_fid_nullable + +Revision ID: 3ec1289eae7a +Revises: 3bac184298c9 +Create Date: 2016-07-20 15:36:28.157723 + +""" + +# revision identifiers, used by Alembic. +revision = '3ec1289eae7a' +down_revision = '3bac184298c9' +branch_labels = None +depends_on = None + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +def upgrade(): + op.alter_column('ofxsource', 'fid', + existing_type=sa.VARCHAR(length=255), + nullable=True) + + +def downgrade(): + op.alter_column('ofxsource', 'fid', + existing_type=sa.VARCHAR(length=255), + nullable=False) diff --git a/vanth/tables.py b/vanth/tables.py index 8b49b65..728ac0a 100644 --- a/vanth/tables.py +++ b/vanth/tables.py @@ -44,7 +44,7 @@ CreditCard = table('credit_card', OFXSource = table('ofxsource', Column('name', String(255), nullable=False), # The name of the institution such as 'America First Credit Union' - Column('fid', String(255), nullable=False), # The FID of the institution, such as 54324 + Column('fid', String(255), nullable=True), # The FID of the institution, such as 54324 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