sling_aptsell/fix_errors.sql

8 lines
597 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.

-- 1. Drop foreign key constraints that prevent data insertion since the parent 'users' table is not part of the replication
ALTER TABLE `demo`.`crm_sales_visit_records` DROP FOREIGN KEY `fk_recorder_id`;
ALTER TABLE `demo`.`user_profiles` DROP FOREIGN KEY `fk_1`;
-- 2. Drop the generated column 'biz_key' in 'crm_acv_targets' and recreate it as a standard VARCHAR column so Sling can import data into it
ALTER TABLE `demo`.`crm_acv_targets` DROP COLUMN `biz_key`;
ALTER TABLE `demo`.`crm_acv_targets` ADD COLUMN `biz_key` VARCHAR(16) NULL COMMENT '业务主键如FY26Q1全年为FY26';