feat(chat): 聊天单向删除
This commit is contained in:
@@ -24,4 +24,4 @@ def upgrade() -> None:
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
op.drop_column("system_cards", 'diy_source')
|
||||
|
||||
@@ -21,18 +21,18 @@ depends_on: Union[str, Sequence[str], None] = None
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('system_products', 'action',
|
||||
existing_type=mysql.ENUM('VIP_RENEWAL', 'RECHARGE_POINTS', 'FREE_GIFT'),
|
||||
comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points',
|
||||
existing_comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points 赠送产品:free_gift',
|
||||
existing_nullable=False)
|
||||
existing_type=mysql.ENUM('VIP_RENEWAL', 'RECHARGE_POINTS', 'FREE_GIFT'),
|
||||
comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points',
|
||||
existing_comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points 赠送产品:free_gift',
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('system_products', 'action',
|
||||
existing_type=mysql.ENUM('VIP_RENEWAL', 'RECHARGE_POINTS', 'FREE_GIFT'),
|
||||
comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points 赠送产品:free_gift',
|
||||
existing_comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points',
|
||||
existing_nullable=False)
|
||||
existing_type=mysql.ENUM('VIP_RENEWAL', 'RECHARGE_POINTS'),
|
||||
comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points',
|
||||
existing_comment='付款后的动作,会员续期:vip_renewal 积分:recharge_points',
|
||||
existing_nullable=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
62
alembic/versions/e9466c397aa2_add_chat_participant_to_orm.py
Normal file
62
alembic/versions/e9466c397aa2_add_chat_participant_to_orm.py
Normal file
@@ -0,0 +1,62 @@
|
||||
"""add chat_participant to orm
|
||||
|
||||
Revision ID: e9466c397aa2
|
||||
Revises: 4a03470b2c09
|
||||
Create Date: 2025-05-15 17:22:26.087396
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'e9466c397aa2'
|
||||
down_revision: Union[str, None] = '4a03470b2c09'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('system_chat_participant',
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('chat_id', sa.Integer(), nullable=False),
|
||||
sa.Column('is_deleted', sa.Boolean, default=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['chat_id'], ['system_chats.id'], ),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['system_users.user_id'], ),
|
||||
sa.PrimaryKeyConstraint('user_id', 'chat_id'),
|
||||
comment='聊天参与者关联表'
|
||||
)
|
||||
op.drop_table('chat_participant')
|
||||
op.alter_column('system_orders', 'status',
|
||||
existing_type=mysql.ENUM('INIT', 'FAIL', 'OK', 'WAIT_PAYMENT', 'PAID', 'CANCEL'),
|
||||
comment='订单状态,init:初始化 fail:失败 ok:完成 wait payment:待支付 paid:已支付 cancel. 取消',
|
||||
existing_comment='订单状态,init:初始化 fail:失败 ok:完成 wait payment:待支付 cancel. 取消',
|
||||
existing_nullable=False,
|
||||
existing_server_default=sa.text("'INIT'"))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('system_orders', 'status',
|
||||
existing_type=mysql.ENUM('INIT', 'FAIL', 'OK', 'WAIT_PAYMENT', 'PAID', 'CANCEL'),
|
||||
comment='订单状态,init:初始化 fail:失败 ok:完成 wait payment:待支付 cancel. 取消',
|
||||
existing_comment='订单状态,init:初始化 fail:失败 ok:完成 wait payment:待支付 paid:已支付 cancel. 取消',
|
||||
existing_nullable=False,
|
||||
existing_server_default=sa.text("'INIT'"))
|
||||
op.create_table('chat_participant',
|
||||
sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
|
||||
sa.Column('chat_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['chat_id'], ['system_chats.id'], name='chat_participant_ibfk_1'),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['system_users.user_id'], name='chat_participant_ibfk_2'),
|
||||
sa.PrimaryKeyConstraint('user_id', 'chat_id'),
|
||||
comment='聊天参与者关联表',
|
||||
mysql_comment='聊天参与者关联表',
|
||||
mysql_default_charset='utf8mb4',
|
||||
mysql_engine='InnoDB'
|
||||
)
|
||||
op.drop_table('system_chat_participant')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user