You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.3 KiB

2 years ago
"""empty message
Revision ID: bb32a1d42ccd
Revises:
Create Date: 2023-05-28 09:46:20.663367
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bb32a1d42ccd'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('email_captcha',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('email', sa.String(length=100), nullable=False),
sa.Column('captcha', sa.String(length=100), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_table('user',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('username', sa.String(length=100), nullable=False),
sa.Column('password', sa.String(length=500), nullable=False),
sa.Column('email', sa.String(length=100), nullable=False),
sa.Column('stu_id', sa.String(length=100), nullable=False),
sa.Column('user_say', sa.String(length=500), nullable=False),
sa.Column('join_time', sa.DateTime(), nullable=True),
sa.Column('address', sa.String(length=100), nullable=False),
sa.Column('enterprise', sa.String(length=100), nullable=False),
sa.Column('user_avatar_url', sa.String(length=100), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email'),
sa.UniqueConstraint('stu_id')
)
op.create_table('videouri',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('video_url', sa.String(length=100), nullable=False),
sa.Column('video_img_src', sa.String(length=100), nullable=False),
sa.Column('video_tite', sa.String(length=100), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_table('favorite',
sa.Column('favorite_id', sa.Integer(), nullable=False),
sa.Column('video_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['favorite_id'], ['user.id'], ),
sa.ForeignKeyConstraint(['video_id'], ['videouri.id'], ),
sa.PrimaryKeyConstraint('favorite_id', 'video_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('favorite')
op.drop_table('videouri')
op.drop_table('user')
op.drop_table('email_captcha')
# ### end Alembic commands ###