36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
"""添加角色心理状态追踪字段
|
|
|
|
Revision ID: 642c76fc69d4
|
|
Revises: 927bcb55b756
|
|
Create Date: 2026-02-12 09:22:09.946923
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = '642c76fc69d4'
|
|
down_revision: Union[str, None] = '927bcb55b756'
|
|
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! ###
|
|
with op.batch_alter_table('characters', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('current_state', sa.Text(), nullable=True, comment='角色当前心理状态(由分析自动更新)'))
|
|
batch_op.add_column(sa.Column('state_updated_chapter', sa.Integer(), nullable=True, comment='心理状态最后更新的章节号'))
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('characters', schema=None) as batch_op:
|
|
batch_op.drop_column('state_updated_chapter')
|
|
batch_op.drop_column('current_state')
|
|
|
|
# ### end Alembic commands ### |