45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
"""add webpage
|
|
|
|
Revision ID: 57f67bce2bec
|
|
Revises: 058739dc7aa6
|
|
Create Date: 2025-09-03 17:52:10.644879
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '57f67bce2bec'
|
|
down_revision: Union[str, Sequence[str], None] = '058739dc7aa6'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('webpage',
|
|
sa.Column('id', sa.String(), nullable=False),
|
|
sa.Column('n', sa.Integer(), nullable=True),
|
|
sa.Column('description', sa.String(), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
with op.batch_alter_table('webpage', schema=None) as batch_op:
|
|
batch_op.create_index(batch_op.f('ix_webpage_id'), ['id'], unique=False)
|
|
batch_op.create_index(batch_op.f('ix_webpage_n'), ['n'], unique=False)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('webpage', schema=None) as batch_op:
|
|
batch_op.drop_index(batch_op.f('ix_webpage_n'))
|
|
batch_op.drop_index(batch_op.f('ix_webpage_id'))
|
|
|
|
op.drop_table('webpage')
|
|
# ### end Alembic commands ###
|