30 lines
794 B
Python
30 lines
794 B
Python
"""新账号默认不开定时启动。已有账号保持原来的开关。"""
|
|
|
|
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"),
|
|
)
|