feat: 新账号默认不开定时启动,首次登录不自动学习

This commit is contained in:
2026-11-17 16:24:31 +08:00
parent 340ce76339
commit e3a6113f4f
3 changed files with 58 additions and 3 deletions
@@ -0,0 +1,29 @@
"""新账号默认不开定时启动。已有账号保持原来的开关。"""
from alembic import op
import sqlalchemy as sa
revision = "0010_schedule_off_by_default"
down_revision = "0009_account_heartbeat"
branch_labels = None
depends_on = None
def upgrade() -> None:
with op.batch_alter_table("accounts") as batch:
batch.alter_column(
"study_schedule_enabled",
existing_type=sa.Boolean(),
existing_nullable=False,
server_default=sa.text("0"),
)
def downgrade() -> None:
with op.batch_alter_table("accounts") as batch:
batch.alter_column(
"study_schedule_enabled",
existing_type=sa.Boolean(),
existing_nullable=False,
server_default=sa.text("1"),
)