"""new table for bought entries with unknown items 2

Revision ID: 2a64d3b9235a
Revises: 015f4256bb4c
Create Date: 2024-06-02 13:19:59.901053

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2a64d3b9235a'
down_revision = '015f4256bb4c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('bought_with_unknown_item',
    sa.Column('token', sa.String(length=15), nullable=False),
    sa.Column('item', sa.BigInteger(), nullable=False),
    sa.Column('date', sa.Date(), nullable=False),
    sa.Column('amount', sa.SmallInteger(), nullable=False),
    sa.ForeignKeyConstraint(['token'], ['login_token.token'], ),
    sa.PrimaryKeyConstraint('token', 'item', 'date')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('bought_with_unknown_item')
    # ### end Alembic commands ###
