From f08e2d97e4c21ec26258bb182b4dfdb048c13409 Mon Sep 17 00:00:00 2001 From: inter Date: Mon, 8 Sep 2025 16:35:40 +0800 Subject: [PATCH] Add File --- backend/alembic/versions/021_user_ws_ddl.py | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 backend/alembic/versions/021_user_ws_ddl.py diff --git a/backend/alembic/versions/021_user_ws_ddl.py b/backend/alembic/versions/021_user_ws_ddl.py new file mode 100644 index 0000000..fe05292 --- /dev/null +++ b/backend/alembic/versions/021_user_ws_ddl.py @@ -0,0 +1,33 @@ +"""021_user_ws_ddl + +Revision ID: 440e9e41da3c +Revises: a6b44114c17f +Create Date: 2025-07-07 17:21:46.858887 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel.sql.sqltypes + + +# revision identifiers, used by Alembic. +revision = '440e9e41da3c' +down_revision = 'a6b44114c17f' +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table( + 'sys_user_ws', + sa.Column('id', sa.BigInteger(), primary_key=True, nullable=False), + sa.Column('uid', sa.BigInteger(), nullable=False), + sa.Column('oid', sa.BigInteger(), nullable=False), + sa.Column('weight', sa.Integer(), nullable=False) + ) + op.create_index(op.f('ix_sys_user_ws_id'), 'sys_user_ws', ['id'], unique=False) + + +def downgrade(): + #op.drop_index(op.f('ix_sys_user_ws_id'), table_name='sys_user_ws') + op.drop_table('sys_user_ws')