-- ============================================
-- 此文件由 Meoo Cloud 自动生成，请勿修改
-- This file is auto-generated by Meoo Cloud, DO NOT MODIFY
-- ============================================


-- 添加唯一约束：一个计划的同类型工厂只能关联一个
-- 先删除可能存在的旧约束
ALTER TABLE plan_factories DROP CONSTRAINT IF EXISTS unique_plan_factory_type;

-- 添加新的唯一约束
ALTER TABLE plan_factories 
ADD CONSTRAINT unique_plan_factory_type 
UNIQUE (plan_id, factory_type);

