From 35a871f8039d774994a5fd6ca463ecb0fc5fcf89 Mon Sep 17 00:00:00 2001 From: inter Date: Mon, 8 Sep 2025 16:35:46 +0800 Subject: [PATCH] Add File --- .../alembic/versions/002_ddl_autogenerate.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 backend/alembic/versions/002_ddl_autogenerate.py diff --git a/backend/alembic/versions/002_ddl_autogenerate.py b/backend/alembic/versions/002_ddl_autogenerate.py new file mode 100644 index 0000000..b77c475 --- /dev/null +++ b/backend/alembic/versions/002_ddl_autogenerate.py @@ -0,0 +1,38 @@ +"""002_ddl_autogenerate + +Revision ID: 1c8bcc7e25c8 +Revises: 5348b743b05f +Create Date: 2025-04-25 17:47:18.795288 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '1c8bcc7e25c8' +down_revision = '5348b743b05f' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('terms', + 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), + sa.Column('create_time', sa.Integer(), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_terms_id'), 'terms', ['id'], unique=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_terms_id'), table_name='terms') + op.drop_table('terms') + # ### end Alembic commands ###