wip
This commit is contained in:
parent
6b1c60a550
commit
839cbd0dc0
17 changed files with 213 additions and 35 deletions
44
migrations/versions/c8516c888495_init.py
Normal file
44
migrations/versions/c8516c888495_init.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
"""init
|
||||
|
||||
Revision ID: c8516c888495
|
||||
Revises:
|
||||
Create Date: 2023-05-25 18:42:37.057225
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c8516c888495'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('pet',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
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.Column('shoe_size', sa.Integer(), nullable=True),
|
||||
sa.Column('pet_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['pet_id'], ['pet.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('hero')
|
||||
op.drop_table('pet')
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue