feat: 每月定时开始学习并改为本地计算心跳摘要

This commit is contained in:
2026-11-15 01:30:24 +08:00
parent e9a1e9b315
commit caa79d79b7
14 changed files with 510 additions and 35 deletions
@@ -0,0 +1,25 @@
"""账号每月自动学习开始时刻。"""
from alembic import op
import sqlalchemy as sa
revision = "0009_study_start"
down_revision = "0008_proxy"
branch_labels = None
depends_on = None
def upgrade() -> None:
with op.batch_alter_table("accounts") as batch:
batch.add_column(sa.Column("study_start_day", sa.Integer(), nullable=False, server_default="1"))
batch.add_column(sa.Column("study_start_hour", sa.Integer(), nullable=False, server_default="0"))
batch.add_column(sa.Column("study_start_minute", sa.Integer(), nullable=False, server_default="0"))
batch.add_column(sa.Column("study_start_second", sa.Integer(), nullable=False, server_default="0"))
def downgrade() -> None:
with op.batch_alter_table("accounts") as batch:
batch.drop_column("study_start_second")
batch.drop_column("study_start_minute")
batch.drop_column("study_start_hour")
batch.drop_column("study_start_day")