| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- """Initial migration
- Revision ID: 9cd4c96d7f08
- Revises:
- Create Date: 2026-01-21 18:15:33.211017
- """
- from alembic import op
- import sqlalchemy as sa
- # revision identifiers, used by Alembic.
- revision = '9cd4c96d7f08'
- down_revision = None
- branch_labels = None
- depends_on = None
- def upgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('carousel',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('image_url', sa.String(length=256), nullable=False),
- sa.Column('link', sa.String(length=256), nullable=True),
- sa.Column('location', sa.String(length=20), nullable=False),
- sa.Column('sort_order', sa.Integer(), nullable=True),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.PrimaryKeyConstraint('id')
- )
- op.create_table('case_category',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('name', sa.String(length=64), nullable=False),
- sa.Column('section', sa.String(length=20), nullable=False),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.PrimaryKeyConstraint('id')
- )
- op.create_table('news',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('title', sa.String(length=128), nullable=False),
- sa.Column('content', sa.Text(), nullable=True),
- sa.Column('image_url', sa.String(length=256), nullable=True),
- sa.Column('author', sa.String(length=64), nullable=True),
- sa.Column('publish_time', sa.DateTime(), nullable=True),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.PrimaryKeyConstraint('id')
- )
- op.create_table('partner',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('name', sa.String(length=128), nullable=False),
- sa.Column('image_url', sa.String(length=256), nullable=True),
- sa.Column('link', sa.String(length=256), nullable=True),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.PrimaryKeyConstraint('id')
- )
- op.create_table('strategic_cooperation',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('name', sa.String(length=128), nullable=False),
- sa.Column('image_url', sa.String(length=256), nullable=True),
- sa.Column('link', sa.String(length=256), nullable=True),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.PrimaryKeyConstraint('id')
- )
- op.create_table('user',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('username', sa.String(length=64), nullable=False),
- sa.Column('password_hash', sa.String(length=256), nullable=True),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.PrimaryKeyConstraint('id'),
- sa.UniqueConstraint('username')
- )
- op.create_table('cooperation_case',
- sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('title', sa.String(length=128), nullable=False),
- sa.Column('image_url', sa.String(length=256), nullable=True),
- sa.Column('description', sa.Text(), nullable=True),
- sa.Column('section', sa.String(length=20), nullable=False),
- sa.Column('category_id', sa.Integer(), nullable=True),
- sa.Column('created_at', sa.DateTime(), nullable=True),
- sa.ForeignKeyConstraint(['category_id'], ['case_category.id'], ),
- sa.PrimaryKeyConstraint('id')
- )
- # ### end Alembic commands ###
- def downgrade():
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('cooperation_case')
- op.drop_table('user')
- op.drop_table('strategic_cooperation')
- op.drop_table('partner')
- op.drop_table('news')
- op.drop_table('case_category')
- op.drop_table('carousel')
- # ### end Alembic commands ###
|