mirror of https://github.com/stijndcl/didier
57 lines
1.8 KiB
Python
57 lines
1.8 KiB
Python
"""Initial currency models
|
|
|
|
Revision ID: 0d03c226d881
|
|
Revises: b2d511552a1f
|
|
Create Date: 2022-06-30 20:02:27.284759
|
|
|
|
"""
|
|
import sqlalchemy as sa
|
|
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "0d03c226d881"
|
|
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),
|
|
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"),
|
|
)
|
|
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(), server_default="0", 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 ###
|