fix: 清掉无用接口和样式,并收紧登录与工号边界

This commit is contained in:
2026-11-16 11:30:59 +08:00
parent 7381b49e4c
commit 5b83b7e415
15 changed files with 232 additions and 329 deletions
@@ -0,0 +1,45 @@
"""工号列加长到 64,并去掉只写不读的课程数量。"""
from alembic import op
import sqlalchemy as sa
revision = "0006_employee_width"
down_revision = "0005_password_login_at"
branch_labels = None
depends_on = None
def upgrade() -> None:
with op.batch_alter_table("accounts") as batch:
batch.alter_column(
"employee_id",
existing_type=sa.String(length=32),
type_=sa.String(length=64),
existing_nullable=False,
)
with op.batch_alter_table("course_sync") as batch:
batch.alter_column(
"last_employee_id",
existing_type=sa.String(length=32),
type_=sa.String(length=64),
existing_nullable=False,
)
batch.drop_column("course_count")
def downgrade() -> None:
with op.batch_alter_table("course_sync") as batch:
batch.add_column(sa.Column("course_count", sa.Integer(), nullable=False, server_default="0"))
batch.alter_column(
"last_employee_id",
existing_type=sa.String(length=64),
type_=sa.String(length=32),
existing_nullable=False,
)
with op.batch_alter_table("accounts") as batch:
batch.alter_column(
"employee_id",
existing_type=sa.String(length=64),
type_=sa.String(length=32),
existing_nullable=False,
)