perf: Alembic script

This commit is contained in:
fit2cloud-chenyw
2025-04-28 12:16:33 +08:00
parent 0796fde819
commit 6dd8631d4d
2 changed files with 1 additions and 48 deletions
@@ -20,7 +20,7 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('terms',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('id', sa.BigInteger(), nullable=False),
sa.Column('term', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
sa.Column('definition', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
sa.Column('domain', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
@@ -28,23 +28,11 @@ def upgrade():
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_terms_id'), 'terms', ['id'], unique=False)
op.drop_table('sys_user')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('sys_user',
sa.Column('id', sa.BIGINT(), autoincrement=True, nullable=False),
sa.Column('account', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
sa.Column('password', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
sa.Column('email', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
sa.Column('oid', sa.BIGINT(), autoincrement=False, nullable=False),
sa.Column('status', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('create_time', sa.BIGINT(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='sys_user_pkey')
)
op.drop_index(op.f('ix_terms_id'), table_name='terms')
op.drop_table('terms')
# ### end Alembic commands ###
@@ -1,35 +0,0 @@
"""003_Upgrade_Term_Table
Revision ID: dd9d72cfd3c4
Revises: 1c8bcc7e25c8
Create Date: 2025-04-27 14:56:29.185812
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = 'dd9d72cfd3c4'
down_revision = '1c8bcc7e25c8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('terms', 'id',
existing_type=sa.INTEGER(),
type_=sa.BigInteger(),
existing_nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('terms', 'id',
existing_type=sa.BigInteger(),
type_=sa.INTEGER(),
existing_nullable=False)
# ### end Alembic commands ###