feat(rohs-check): 新增 RoHS 检核工具 API 及相关功能
This commit is contained in:
1 parent
8a541211b7
commit
24551e9a9a
39 files changed
+3128
-189
No files matched your search
@@ -0,0 +1,50 @@
|
||||
"""add rohs schedule kb sync fields
|
||||
|
||||
Revision ID: b8c9d0e1f2a3
|
||||
Revises: 5569936e6e0b
|
||||
Create Date: 2026-06-09 00:00:00.000000
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = 'b8c9d0e1f2a3'
|
||||
down_revision = '5569936e6e0b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('schedule_tasks', sa.Column('kb_sync_enabled', sa.Boolean(), server_default=sa.text('false'), nullable=False))
|
||||
op.add_column('schedule_tasks', sa.Column('kb_group_id', sa.Integer(), nullable=True))
|
||||
op.create_index('ix_schedule_tasks_kb_group_id', 'schedule_tasks', ['kb_group_id'])
|
||||
op.create_foreign_key('fk_schedule_tasks_kb_group_id_kb_groups', 'schedule_tasks', 'kb_groups', ['kb_group_id'], ['id'])
|
||||
|
||||
op.add_column('schedule_runs', sa.Column('kb_sync_status', sa.String(length=32), nullable=True))
|
||||
op.add_column('schedule_runs', sa.Column('kb_group_id', sa.Integer(), nullable=True))
|
||||
op.add_column('schedule_runs', sa.Column('kb_document_id', sa.Integer(), nullable=True))
|
||||
op.add_column('schedule_runs', sa.Column('kb_document_version_id', sa.Integer(), nullable=True))
|
||||
op.add_column('schedule_runs', sa.Column('kb_sync_job_id', sa.Integer(), nullable=True))
|
||||
op.add_column('schedule_runs', sa.Column('kb_sync_error', sa.Text(), nullable=True))
|
||||
op.create_foreign_key('fk_schedule_runs_kb_group_id_kb_groups', 'schedule_runs', 'kb_groups', ['kb_group_id'], ['id'])
|
||||
op.create_foreign_key('fk_schedule_runs_kb_document_id_kb_documents', 'schedule_runs', 'kb_documents', ['kb_document_id'], ['id'])
|
||||
op.create_foreign_key('fk_schedule_runs_kb_document_version_id_kb_document_versions', 'schedule_runs', 'kb_document_versions', ['kb_document_version_id'], ['id'])
|
||||
op.create_foreign_key('fk_schedule_runs_kb_sync_job_id_kb_jobs', 'schedule_runs', 'kb_jobs', ['kb_sync_job_id'], ['id'])
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_constraint('fk_schedule_runs_kb_sync_job_id_kb_jobs', 'schedule_runs', type_='foreignkey')
|
||||
op.drop_constraint('fk_schedule_runs_kb_document_version_id_kb_document_versions', 'schedule_runs', type_='foreignkey')
|
||||
op.drop_constraint('fk_schedule_runs_kb_document_id_kb_documents', 'schedule_runs', type_='foreignkey')
|
||||
op.drop_constraint('fk_schedule_runs_kb_group_id_kb_groups', 'schedule_runs', type_='foreignkey')
|
||||
op.drop_column('schedule_runs', 'kb_sync_error')
|
||||
op.drop_column('schedule_runs', 'kb_sync_job_id')
|
||||
op.drop_column('schedule_runs', 'kb_document_version_id')
|
||||
op.drop_column('schedule_runs', 'kb_document_id')
|
||||
op.drop_column('schedule_runs', 'kb_group_id')
|
||||
op.drop_column('schedule_runs', 'kb_sync_status')
|
||||
|
||||
op.drop_constraint('fk_schedule_tasks_kb_group_id_kb_groups', 'schedule_tasks', type_='foreignkey')
|
||||
op.drop_index('ix_schedule_tasks_kb_group_id', table_name='schedule_tasks')
|
||||
op.drop_column('schedule_tasks', 'kb_group_id')
|
||||
op.drop_column('schedule_tasks', 'kb_sync_enabled')
|
||||
Reference in new issue
Block a user