didier/alembic/versions/0d03c226d881_initial_curren...

57 lines
1.8 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
"""
import sqlalchemy as sa
2022-07-19 18:49:22 +02:00
from alembic import op
2022-06-30 19:42:48 +02:00
# revision identifiers, used by Alembic.
2022-07-19 18:49:22 +02:00
revision = "0d03c226d881"
down_revision = "b2d511552a1f"
2022-06-30 19:42:48 +02:00
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
2022-07-19 18:49:22 +02:00
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),
sa.Column("dinks", sa.BigInteger(), server_default="0", nullable=False),
sa.Column("interest_level", sa.Integer(), server_default="1", nullable=False),
sa.Column("capacity_level", sa.Integer(), server_default="1", nullable=False),
sa.Column("rob_level", sa.Integer(), server_default="1", nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["users.user_id"],
),
sa.PrimaryKeyConstraint("bank_id"),
2022-06-30 19:42:48 +02:00
)
2022-07-19 18:49:22 +02:00
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.Date, nullable=True),
2022-07-19 18:49:22 +02:00
sa.Column("count", sa.Integer(), server_default="0", nullable=False),
sa.ForeignKeyConstraint(
["user_id"],
["users.user_id"],
),
sa.PrimaryKeyConstraint("nightly_id"),
2022-06-30 19:42:48 +02:00
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
2022-07-19 18:49:22 +02:00
op.drop_table("nightly_data")
op.drop_table("bank")
op.drop_table("users")
2022-06-30 19:42:48 +02:00
# ### end Alembic commands ###