Add the account ID to the ofxaccount table

This is how we'll store the account ID we need to send to the
institution to identify the account we want to pull records from
This commit is contained in:
Eli Ribble 2016-06-23 08:32:55 -06:00
parent 1f978a3f28
commit f485f03f0c
2 changed files with 36 additions and 6 deletions

View File

@ -0,0 +1,28 @@
"""ofxaccount account_id
Revision ID: 4b8ce290f890
Revises: 2d295ac0fc07
Create Date: 2016-06-23 08:32:42.429402
"""
# revision identifiers, used by Alembic.
revision = '4b8ce290f890'
down_revision = '2d295ac0fc07'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('ofxaccount', sa.Column('account_id', sa.String(length=255), nullable=False))
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column('ofxaccount', 'account_id')
### end Alembic commands ###

View File

@ -45,15 +45,17 @@ OFXSource = Table('ofxsource', metadata,
)
OFXAccount = Table('ofxaccount', metadata,
Column('uuid', UUID(as_uuid=True), primary_key=True),
Column('account_id', String(255), nullable=False), # 123456-0.9:CHK
Column('name', String(255), nullable=False), # My checking account
Column('user_id', String(255), nullable=False), # The user ID for the bank
Column('password', String(255), nullable=False), # The encrypted password for the account
Column('type', String(255), nullable=False), # The account type, like 'checking'
Column('source', None, ForeignKey(OFXSource.c.uuid, name='fk_ofxsource'), nullable=False),
Column('owner', None, ForeignKey(User.c.uuid, name='fk_user'), nullable=False),
Column('password', String(255), nullable=False), # The encrypted password for the account
Column('source', None, ForeignKey(OFXSource.c.uuid, name='fk_ofxsource'), nullable=False),
Column('type', String(255), nullable=False), # The account type, like 'checking'
Column('user_id', String(255), nullable=False), # The user ID for the bank
Column('uuid', UUID(as_uuid=True), primary_key=True),
Column('created', DateTime(), nullable=False, server_default=func.now()),
Column('updated', DateTime(), nullable=False, server_default=func.now(), onupdate=func.now()),
Column('updated', DateTime(), nullable=False, server_default=func.now(), onupdate=func.now()),
)
OFXRecord = Table('ofxrecord', metadata,