mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
* 🔧 启用一些 ruff 的新规则 * ➕ 添加开发依赖 nonebot-adapter-qq * ➕ 添加依赖 nonebot-plugin-session * ➕ 添加依赖 nonebot-plugin-session-orm * 🔧 忽略 ruff 规则 ISC001 format 冲突风险 * 🚨 修复 ruff 警报 * ♻️ 重构! * ♻️ 恢复定时获取 TetraLeague 数据的功能 * ✨ 统一处理需要捕获的错误 * ✨ 记录用户触发的指令
55 lines
1.7 KiB
Python
55 lines
1.7 KiB
Python
"""Rename field
|
|
|
|
迁移 ID: 09d4bb60160d
|
|
父迁移: b9d65badc713
|
|
创建时间: 2024-04-23 23:42:04.541672
|
|
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
if TYPE_CHECKING:
|
|
from collections.abc import Sequence
|
|
|
|
revision: str = '09d4bb60160d'
|
|
down_revision: str | Sequence[str] | None = 'b9d65badc713'
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade(name: str = '') -> None:
|
|
if name:
|
|
return
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('nonebot_plugin_tetris_stats_iorank', schema=None) as batch_op:
|
|
batch_op.alter_column('create_time', new_column_name='update_time', existing_type=sa.DateTime())
|
|
batch_op.drop_index('ix_nonebot_plugin_tetris_stats_iorank_create_time')
|
|
op.create_index(
|
|
batch_op.f('ix_nonebot_plugin_tetris_stats_iorank_update_time'),
|
|
'nonebot_plugin_tetris_stats_iorank',
|
|
['update_time'],
|
|
unique=False,
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade(name: str = '') -> None:
|
|
if name:
|
|
return
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('nonebot_plugin_tetris_stats_iorank', schema=None) as batch_op:
|
|
batch_op.alter_column('update_time', new_column_name='create_time')
|
|
batch_op.drop_index(batch_op.f('ix_nonebot_plugin_tetris_stats_iorank_update_time'))
|
|
op.create_index(
|
|
'ix_nonebot_plugin_tetris_stats_iorank_create_time',
|
|
'nonebot_plugin_tetris_stats_iorank',
|
|
['create_time'],
|
|
unique=False,
|
|
)
|
|
# ### end Alembic commands ###
|