ETest-Vue-FastAPI/fix_batch_id_bigint.sql

20 lines
520 B
SQL
Raw Permalink 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.

-- 紧急修复:将 batch_id 字段改为 BIGINT 类型
-- 解决 "Out of range value for column 'batch_id'" 错误
-- 修改 batch_id 字段类型为 BIGINT
ALTER TABLE test_work_order
MODIFY COLUMN batch_id BIGINT NULL COMMENT '工单批次ID用于分组标识';
-- 验证修改
DESCRIBE test_work_order;
-- 查看字段类型
SELECT
COLUMN_NAME,
COLUMN_TYPE,
IS_NULLABLE,
COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'test_work_order'
AND COLUMN_NAME = 'batch_id';