"""menu table add
|
|
Revision ID: 3845dc998475
|
Revises: abc6bb9129ed
|
Create Date: 2024-12-10 14:22:03.798597
|
|
"""
|
from typing import Sequence, Union
|
|
from alembic import op
|
import sqlalchemy as sa
|
from sqlalchemy.dialects import mysql
|
|
# revision identifiers, used by Alembic.
|
revision: str = '3845dc998475'
|
down_revision: Union[str, None] = 'abc6bb9129ed'
|
branch_labels: Union[str, Sequence[str], None] = None
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
def upgrade() -> None:
|
# ### commands auto generated by Alembic - please adjust! ###
|
op.create_table('menu_capacity',
|
sa.Column('id', sa.Integer(), nullable=False),
|
sa.Column('menu_id', sa.Integer(), nullable=True),
|
sa.Column('capacity_id', sa.String(length=36), nullable=True),
|
sa.Column('capacity_type', sa.Integer(), nullable=True),
|
sa.PrimaryKeyConstraint('id'),
|
sa.UniqueConstraint('menu_id', 'capacity_id', name='menu_capacity_id_ix')
|
)
|
op.create_index(op.f('ix_menu_capacity_id'), 'menu_capacity', ['id'], unique=False)
|
op.create_table('web_menu',
|
sa.Column('id', sa.Integer(), nullable=False),
|
sa.Column('title', sa.String(length=128), nullable=True),
|
sa.Column('dialog', sa.String(length=1000), nullable=True),
|
sa.Column('desc', sa.String(length=1000), nullable=True),
|
sa.Column('icon', sa.String(length=16), nullable=True),
|
sa.Column('img', sa.String(length=255), nullable=True),
|
sa.PrimaryKeyConstraint('id')
|
)
|
op.create_index(op.f('ix_web_menu_id'), 'web_menu', ['id'], unique=False)
|
op.drop_column('knowledgebase', 'count')
|
# ### end Alembic commands ###
|
|
|
def downgrade() -> None:
|
# ### commands auto generated by Alembic - please adjust! ###
|
op.add_column('knowledgebase', sa.Column('count', mysql.VARCHAR(length=32), nullable=True))
|
op.drop_index(op.f('ix_web_menu_id'), table_name='web_menu')
|
op.drop_table('web_menu')
|
op.drop_index(op.f('ix_menu_capacity_id'), table_name='menu_capacity')
|
op.drop_table('menu_capacity')
|
# ### end Alembic commands ###
|