36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
"""add hero.lighting
|
|
|
|
Revision ID: a1cd0a1947be
|
|
Revises: c79214cdc7b3
|
|
Create Date: 2023-06-28 19:43:47.108749
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlmodel
|
|
from learn_sql_model.er_diagram import generate_er_diagram, generate_er_markdown
|
|
from learn_sql_model.config import get_config
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'a1cd0a1947be'
|
|
down_revision = 'c79214cdc7b3'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('hero', sa.Column('flashlight_strength', sa.Integer(), nullable=True))
|
|
op.add_column('hero', sa.Column('lanturn_strength', sa.Integer(), nullable=True))
|
|
# ### end Alembic commands ###
|
|
generate_er_diagram(f'migrations/versions/{revision}_er_diagram.png')
|
|
generate_er_markdown(f'migrations/versions/{revision}_er_diagram.md', f'migrations/versions/er_diagram_{revision}.png')
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_column('hero', 'lanturn_strength')
|
|
op.drop_column('hero', 'flashlight_strength')
|
|
# ### end Alembic commands ###
|