-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from /issues/183
Fixes #183 - UI to ignore OFXTransactions, and ignore is_ OFXTransactions
- Loading branch information
Showing
22 changed files
with
1,194 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
biweeklybudget/alembic/versions/073142f641b3_account_remove_re_field_defaults.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
"""Account remove re field defaults | ||
Revision ID: 073142f641b3 | ||
Revises: 08b6358a04bf | ||
Create Date: 2018-03-08 09:25:17.673039 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import mysql | ||
from sqlalchemy.ext.declarative import declarative_base | ||
from sqlalchemy.orm import sessionmaker | ||
from sqlalchemy import Column, Integer, String | ||
|
||
Session = sessionmaker() | ||
|
||
Base = declarative_base() | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '073142f641b3' | ||
down_revision = '08b6358a04bf' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
class Account(Base): | ||
|
||
__tablename__ = 'accounts' | ||
__table_args__ = ( | ||
{'mysql_engine': 'InnoDB'} | ||
) | ||
|
||
#: Primary Key | ||
id = Column(Integer, primary_key=True) | ||
|
||
#: regex for matching transactions as interest charges | ||
re_interest_charge = Column(String(254)) | ||
|
||
#: regex for matching transactions as interest paid | ||
re_interest_paid = Column(String(254)) | ||
|
||
#: regex for matching transactions as payments | ||
re_payment = Column(String(254)) | ||
|
||
#: regex for matching transactions as late fees | ||
re_fee = Column(String(254)) | ||
|
||
|
||
def upgrade(): | ||
bind = op.get_bind() | ||
session = Session(bind=bind) | ||
for acct in session.query(Account).all(): | ||
acct.re_interest_charge = None | ||
acct.re_interest_paid = None | ||
acct.re_payment = None | ||
acct.re_fee = None | ||
session.commit() | ||
op.add_column( | ||
'accounts', | ||
sa.Column('re_late_fee', sa.String(length=254), nullable=True) | ||
) | ||
op.add_column( | ||
'accounts', | ||
sa.Column('re_other_fee', sa.String(length=254), nullable=True) | ||
) | ||
op.drop_column('accounts', 're_fee') | ||
|
||
|
||
def downgrade(): | ||
op.add_column( | ||
'accounts', | ||
sa.Column('re_fee', mysql.VARCHAR(length=254), nullable=True) | ||
) | ||
op.drop_column('accounts', 're_other_fee') | ||
op.drop_column('accounts', 're_late_fee') | ||
bind = op.get_bind() | ||
session = Session(bind=bind) | ||
for acct in session.query(Account).all(): | ||
acct.re_interest_charge = '^(interest charge|purchase finance charge)' | ||
acct.re_interest_paid = '^interest paid' | ||
acct.re_payment = '^(online payment|' \ | ||
'internet payment|online pymt|payment)' | ||
acct.re_fee = '^(late fee|past due fee)' | ||
session.commit() |
34 changes: 34 additions & 0 deletions
34
biweeklybudget/alembic/versions/08b6358a04bf_txnreconcile_allow_txn_id_to_be_null.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""TxnReconcile allow txn_id to be null | ||
Revision ID: 08b6358a04bf | ||
Revises: 04e61490804b | ||
Create Date: 2018-03-07 19:48:06.050926 | ||
""" | ||
from alembic import op | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '08b6358a04bf' | ||
down_revision = '04e61490804b' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.alter_column( | ||
'txn_reconciles', 'txn_id', | ||
existing_type=mysql.INTEGER(display_width=11), | ||
nullable=True | ||
) | ||
|
||
|
||
def downgrade(): | ||
conn = op.get_bind() | ||
conn.execute("SET FOREIGN_KEY_CHECKS=0") | ||
op.alter_column( | ||
'txn_reconciles', 'txn_id', | ||
existing_type=mysql.INTEGER(display_width=11), | ||
nullable=False | ||
) | ||
conn.execute("SET FOREIGN_KEY_CHECKS=1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.