ETest-Vue-FastAPI/add_workorder_batch_field.sql

27 lines
676 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- 添加工单批次字段
-- 将 test_order_id 改为 batch_id用于标识同一批次的工单
-- 1. 重命名字段并修改类型为 BIGINT保留数据
ALTER TABLE test_work_order
CHANGE COLUMN test_order_id batch_id BIGINT NULL COMMENT '工单批次ID用于分组标识';
-- 2. 添加批次名称字段
ALTER TABLE test_work_order
ADD COLUMN batch_name VARCHAR(100) NULL COMMENT '工单批次名称' AFTER batch_id;
-- 3. 查看表结构
DESCRIBE test_work_order;
-- 4. 查看最近的工单数据
SELECT
id,
batch_id,
batch_name,
name,
test_eut_id,
order_id,
create_time
FROM test_work_order
ORDER BY id DESC
LIMIT 20;