didier/alembic/versions/0d03c226d881_initial_curren...

52 lines
1.6 KiB
Python
Raw Normal View History

2022-06-30 19:42:48 +02:00
"""Initial currency models
2022-06-30 21:17:48 +02:00
Revision ID: 0d03c226d881
2022-06-30 19:42:48 +02:00
Revises: b2d511552a1f
2022-06-30 21:17:48 +02:00
Create Date: 2022-06-30 20:02:27.284759
2022-06-30 19:42:48 +02:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
2022-06-30 21:17:48 +02:00
revision = '0d03c226d881'
2022-06-30 19:42:48 +02:00
down_revision = 'b2d511552a1f'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('users',
sa.Column('user_id', sa.BigInteger(), nullable=False),
sa.PrimaryKeyConstraint('user_id')
)
op.create_table('bank',
sa.Column('bank_id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.BigInteger(), nullable=True),
2022-06-30 21:17:48 +02:00
sa.Column('dinks', sa.BigInteger(), nullable=False),
2022-06-30 19:42:48 +02:00
sa.Column('interest_level', sa.Integer(), nullable=False),
sa.Column('capacity_level', sa.Integer(), nullable=False),
sa.Column('rob_level', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
sa.PrimaryKeyConstraint('bank_id')
)
op.create_table('nightly_data',
sa.Column('nightly_id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.BigInteger(), nullable=True),
sa.Column('last_nightly', sa.DateTime(timezone=True), nullable=True),
sa.Column('count', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
sa.PrimaryKeyConstraint('nightly_id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('nightly_data')
op.drop_table('bank')
op.drop_table('users')
# ### end Alembic commands ###