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

DROP POLICY IF EXISTS users_select_plans ON production_plans; DROP POLICY IF EXISTS purchaser_select_plans ON production_plans; DROP POLICY IF EXISTS textile_select_plans ON production_plans; CREATE POLICY purchaser_select_own_plans ON production_plans FOR SELECT USING (purchaser_id = get_user_master_company_id()); CREATE POLICY factory_select_linked_plans ON production_plans FOR SELECT USING (EXISTS (SELECT 1 FROM plan_factories WHERE plan_factories.plan_id = production_plans.id AND plan_factories.factory_id = get_user_master_company_id()));
