From 02ddae18c184811f76f30aa64711b7cf8fb471ea Mon Sep 17 00:00:00 2001 From: inter Date: Mon, 8 Sep 2025 16:35:47 +0800 Subject: [PATCH] Add File --- backend/alembic/versions/022_assistant_ddl.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 backend/alembic/versions/022_assistant_ddl.py diff --git a/backend/alembic/versions/022_assistant_ddl.py b/backend/alembic/versions/022_assistant_ddl.py new file mode 100644 index 0000000..a5fd869 --- /dev/null +++ b/backend/alembic/versions/022_assistant_ddl.py @@ -0,0 +1,35 @@ +"""022_assistant_ddl + +Revision ID: e6b20ae73606 +Revises: 440e9e41da3c +Create Date: 2025-07-09 18:20:27.160183 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = 'e6b20ae73606' +down_revision = '440e9e41da3c' +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table( + 'sys_assistant', + sa.Column('id', sa.BigInteger(), primary_key=True, nullable=False), + sa.Column('name', sa.String(255), nullable=False), + sa.Column('domain', sa.String(255), nullable=False), + sa.Column('type', sa.Integer(), nullable=False, default=0), + sa.Column('configuration', sa.Text(), nullable=True), + sa.Column('create_time', sa.BigInteger(), default=0, nullable=False) + ) + op.create_index(op.f('ix_sys_assistant_id'), 'sys_assistant', ['id'], unique=False) + + +def downgrade(): + op.drop_index(op.f('ix_sys_assistant_id'), table_name='sys_assistant') + op.drop_table('sys_assistant')