-
Notifications
You must be signed in to change notification settings - Fork 2
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 #136 from EduardSchwarzkopf/add-scheduled-transact…
…ions feat: Add scheduled transactions
- Loading branch information
Showing
65 changed files
with
3,608 additions
and
865 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,4 +133,5 @@ logs/ | |
.env.* | ||
!.env.test | ||
|
||
start-dev.sh | ||
start-dev.sh | ||
docker-compose.db.yml |
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
30 changes: 30 additions & 0 deletions
30
alembic/versions/3d95cdfbdd44_add_is_active_to_scheduled_transactions.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,30 @@ | ||
"""add is_active to scheduled transactions | ||
Revision ID: 3d95cdfbdd44 | ||
Revises: b8097c295e4a | ||
Create Date: 2024-06-23 09:14:17.818896 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '3d95cdfbdd44' | ||
down_revision: Union[str, None] = 'b8097c295e4a' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('transactions_scheduled', sa.Column('is_active', sa.Boolean(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('transactions_scheduled', 'is_active') | ||
# ### end Alembic commands ### |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
"""update transaction model | ||
Revision ID: b8097c295e4a | ||
Revises: ebc9a4757806 | ||
Create Date: 2024-05-20 17:41:41.567122 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = 'b8097c295e4a' | ||
down_revision: Union[str, None] = 'ebc9a4757806' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('transactions', sa.Column('scheduled_transaction_id', sa.Integer(), nullable=True)) | ||
op.alter_column('transactions', 'account_id', | ||
existing_type=sa.INTEGER(), | ||
nullable=False) | ||
op.alter_column('transactions', 'information_id', | ||
existing_type=sa.INTEGER(), | ||
nullable=False) | ||
op.create_unique_constraint('uq_scheduled_transaction_date', 'transactions', ['scheduled_transaction_id', 'information_id']) | ||
op.create_foreign_key(None, 'transactions', 'transactions_scheduled', ['scheduled_transaction_id'], ['id'], ondelete='SET NULL') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, 'transactions', type_='foreignkey') | ||
op.drop_constraint('uq_scheduled_transaction_date', 'transactions', type_='unique') | ||
op.alter_column('transactions', 'information_id', | ||
existing_type=sa.INTEGER(), | ||
nullable=True) | ||
op.alter_column('transactions', 'account_id', | ||
existing_type=sa.INTEGER(), | ||
nullable=True) | ||
op.drop_column('transactions', 'scheduled_transaction_id') | ||
# ### end Alembic commands ### |
30 changes: 30 additions & 0 deletions
30
alembic/versions/dbce8a11ecc2_add_default_value_for_is_active.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,30 @@ | ||
"""add default value for is_active | ||
Revision ID: dbce8a11ecc2 | ||
Revises: 3d95cdfbdd44 | ||
Create Date: 2024-06-23 09:21:50.927292 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "dbce8a11ecc2" | ||
down_revision: Union[str, None] = "3d95cdfbdd44" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade(): | ||
op.alter_column( | ||
"transactions_scheduled", "is_active", server_default=sa.text("true") | ||
) | ||
op.execute("UPDATE transactions_scheduled SET is_active = true") | ||
|
||
|
||
def downgrade(): | ||
op.alter_column("transactions_scheduled", "is_active", server_default=None) |
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
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.