26 lines
963 B
Python
26 lines
963 B
Python
"""账号每月自动学习开始时刻。"""
|
|
|
|
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")
|