"""add transaction splits Revision ID: 7b535ef9e189 Revises: 3e3503b61b20 Create Date: 2026-08-30 15:00:00.000000 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '7b535ef9e189' down_revision: Union[str, None] = '3e3503b61b20' branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: op.create_table( 'transaction_splits', sa.Column('id', sa.Integer(), nullable=False), sa.Column('transaction_id', sa.Integer(), nullable=False), sa.Column('category_id', sa.Integer(), nullable=True), sa.Column('amount', sa.Numeric(precision=14, scale=2), nullable=False), sa.Column('note', sa.String(length=200), nullable=True), sa.ForeignKeyConstraint(['transaction_id'], ['transactions.id'], ondelete='CASCADE'), sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ondelete='SET NULL'), sa.PrimaryKeyConstraint('id'), ) def downgrade() -> None: op.drop_table('transaction_splits')