Files
MBTI_wang/api/database/add_test_commission_fields.sql
2026-03-17 12:39:38 +08:00

10 lines
564 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 为测试完成佣金补充 commission_records 新字段
-- 执行前请先确认表前缀是否为 mbti_
ALTER TABLE `mbti_commission_records`
ADD COLUMN `testResultId` int(11) NULL DEFAULT NULL COMMENT '测试结果ID测试完成佣金使用关联 test_results.id' AFTER `orderId`,
ADD COLUMN `commissionSource` varchar(20) NOT NULL DEFAULT 'payment' COMMENT '佣金来源: payment|test_completion' AFTER `testResultId`;
ALTER TABLE `mbti_commission_records`
ADD UNIQUE KEY `uk_test_commission` (`testResultId`, `commissionSource`);