init
This commit is contained in:
commit
4be274d9e2
39 changed files with 2548 additions and 0 deletions
41
migrations/versions/fe841f5746e5_initial_migration.py
Normal file
41
migrations/versions/fe841f5746e5_initial_migration.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
"""Initial Migration
|
||||
|
||||
Revision ID: fe841f5746e5
|
||||
Revises:
|
||||
Create Date: 2023-05-18 11:07:41.700265
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "fe841f5746e5"
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"hero",
|
||||
sa.Column("id", sa.Integer(), nullable=False),
|
||||
sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.Column("secret_name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.Column("age", sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
op.create_table(
|
||||
"pet",
|
||||
sa.Column("id", sa.Integer(), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id"),
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table("pet")
|
||||
op.drop_table("hero")
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue