mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-09 01:36:57 +08:00
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
"""049_user_platform_ddl
|
|
|
|
Revision ID: b58a71ca6ae3
|
|
Revises: 073bf544b373
|
|
Create Date: 2025-11-04 12:31:56.481582
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlmodel.sql.sqltypes
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'b58a71ca6ae3'
|
|
down_revision = '073bf544b373'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('sys_user_platform',
|
|
sa.Column('uid', sa.BigInteger(), nullable=False),
|
|
sa.Column('origin', sa.Integer(), server_default='0', nullable=False),
|
|
sa.Column('platform_uid', sa.String(255), nullable=False),
|
|
sa.Column('id', sa.BigInteger(), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_sys_user_platform_id'), 'sys_user_platform', ['id'], unique=False)
|
|
|
|
op.add_column('sys_user', sa.Column('origin', sa.Integer(), server_default='0', nullable=False))
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.drop_column('sys_user', 'origin')
|
|
|
|
op.drop_index(op.f('ix_sys_user_platform_id'), table_name='sys_user_platform')
|
|
op.drop_table('sys_user_platform')
|
|
# ### end Alembic commands ###
|