feat(schedule):cron支持图形,RoHS检核增加进度显示
This commit is contained in:
1 parent
6d0e78be81
commit
f5aac9c893
46 files changed
+1987
-221
No files matched your search
@@ -0,0 +1,51 @@
|
||||
"""add schedule_timezone to schedule_tasks
|
||||
|
||||
Revision ID: c9d0e1f2a3b4
|
||||
Revises: b8c9d0e1f2a3
|
||||
Create Date: 2026-06-12 00:00:00.000000
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "c9d0e1f2a3b4"
|
||||
down_revision = "b8c9d0e1f2a3"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
bind = op.get_bind()
|
||||
insp = sa.inspect(bind)
|
||||
if "schedule_tasks" not in set(insp.get_table_names()):
|
||||
return
|
||||
columns = {col["name"] for col in insp.get_columns("schedule_tasks")}
|
||||
if "schedule_timezone" not in columns:
|
||||
with op.batch_alter_table("schedule_tasks", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column(
|
||||
"schedule_timezone",
|
||||
sa.String(length=64),
|
||||
nullable=True,
|
||||
)
|
||||
)
|
||||
op.execute("UPDATE schedule_tasks SET schedule_timezone = 'Asia/Shanghai' WHERE schedule_timezone IS NULL")
|
||||
with op.batch_alter_table("schedule_tasks", schema=None) as batch_op:
|
||||
batch_op.alter_column(
|
||||
"schedule_timezone",
|
||||
existing_type=sa.String(length=64),
|
||||
server_default=sa.text("'Asia/Shanghai'"),
|
||||
nullable=False,
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
bind = op.get_bind()
|
||||
insp = sa.inspect(bind)
|
||||
if "schedule_tasks" not in set(insp.get_table_names()):
|
||||
return
|
||||
columns = {col["name"] for col in insp.get_columns("schedule_tasks")}
|
||||
if "schedule_timezone" in columns:
|
||||
with op.batch_alter_table("schedule_tasks", schema=None) as batch_op:
|
||||
batch_op.drop_column("schedule_timezone")
|
||||
Reference in new issue
Block a user