This commit is contained in:
2026-09-06 12:26:53 +02:00
parent bbe1406afb
commit d2d7c7fa74
8 changed files with 179 additions and 51 deletions
+37 -28
View File
@@ -1,10 +1,11 @@
"""empty message
Revision ID: 605e46acc08e
Revises:
Revises:
Create Date: 2026-09-04 14:52:00.681450
"""
from collections.abc import Sequence
import sqlalchemy as sa
@@ -12,7 +13,7 @@ import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = '605e46acc08e'
revision: str = "605e46acc08e"
down_revision: str | Sequence[str] | None = None
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
@@ -21,31 +22,39 @@ depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('category',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('name', sa.String(), nullable=False),
sa.Column('parent_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['parent_id'], ['category.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name', 'parent_id', name='uq_category_name_parent')
op.create_table(
"category",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("name", sa.String(), nullable=False),
sa.Column("parent_id", sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(
["parent_id"],
["category.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name", "parent_id", name="uq_category_name_parent"),
)
op.create_table('import_b4w',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('id_b4w', sa.Integer(), nullable=False),
sa.Column('account_iban', sa.String(), nullable=False),
sa.Column('account_currency', sa.String(length=3), nullable=False),
sa.Column('date_valid', sa.Date(), nullable=False),
sa.Column('date_book', sa.Date(), nullable=True),
sa.Column('amount', sa.Numeric(precision=12, scale=2), nullable=False),
sa.Column('amount_currency', sa.String(length=3), nullable=False),
sa.Column('reference', sa.String(), nullable=True),
sa.Column('other_name', sa.String(), nullable=True),
sa.Column('other_iban', sa.String(), nullable=True),
sa.Column('category_id', sa.Integer(), nullable=True),
sa.Column('notes', sa.String(), nullable=True),
sa.ForeignKeyConstraint(['category_id'], ['category.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('id_b4w')
op.create_table(
"import_b4w",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("id_b4w", sa.Integer(), nullable=False),
sa.Column("account_iban", sa.String(), nullable=False),
sa.Column("account_currency", sa.String(length=3), nullable=False),
sa.Column("date_valid", sa.Date(), nullable=False),
sa.Column("date_book", sa.Date(), nullable=True),
sa.Column("amount", sa.Numeric(precision=12, scale=2), nullable=False),
sa.Column("amount_currency", sa.String(length=3), nullable=False),
sa.Column("reference", sa.String(), nullable=True),
sa.Column("other_name", sa.String(), nullable=True),
sa.Column("other_iban", sa.String(), nullable=True),
sa.Column("category_id", sa.Integer(), nullable=True),
sa.Column("notes", sa.String(), nullable=True),
sa.ForeignKeyConstraint(
["category_id"],
["category.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("id_b4w"),
)
# ### end Alembic commands ###
@@ -53,6 +62,6 @@ def upgrade() -> None:
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('import_b4w')
op.drop_table('category')
op.drop_table("import_b4w")
op.drop_table("category")
# ### end Alembic commands ###