diff --git a/src/main/resources/neatlogic/resources/process/changelog/2024-07-26/neatlogic_tenant.sql b/src/main/resources/neatlogic/resources/process/changelog/2024-07-26/neatlogic_tenant.sql index bf85c238fb4a2dee82c39395bc3a598d17f9414f..fa5804da931bee3b801e407a3c91be34242f81d5 100644 --- a/src/main/resources/neatlogic/resources/process/changelog/2024-07-26/neatlogic_tenant.sql +++ b/src/main/resources/neatlogic/resources/process/changelog/2024-07-26/neatlogic_tenant.sql @@ -1,5 +1,12 @@ -INSERT IGNORE INTO `channel_authority` (`channel_uuid`, `type`, `uuid`, `action`) SELECT `uuid`, 'common', 'alluser', 'view' FROM channel; +INSERT IGNORE INTO `channel_authority` (`channel_uuid`, `type`, `uuid`, `action`) +SELECT a.`uuid`, 'common', 'alluser', 'view' FROM channel a +LEFT JOIN `channel_authority` b ON b.`channel_uuid` = a.`uuid` +WHERE b.`channel_uuid` IS NULL; -INSERT IGNORE INTO `catalog_authority` (`catalog_uuid`, `type`, `uuid`, `action`) SELECT `uuid`, 'common', 'alluser', 'view' FROM catalog; +INSERT IGNORE INTO `catalog_authority` (`catalog_uuid`, `type`, `uuid`, `action`) +SELECT a.`uuid`, 'common', 'alluser', 'view' FROM catalog a +LEFT JOIN `catalog_authority` b ON b.`catalog_uuid` = a.`uuid` +WHERE b.`catalog_uuid` IS NULL; -UPDATE `channel` SET `is_active_priority` = 0, `is_display_priority` = 0 WHERE `uuid` NOT IN (SELECT DISTINCT `channel_uuid` FROM `channel_priority`); \ No newline at end of file +UPDATE `channel` SET `is_active_priority` = 0, `is_display_priority` = 0 +WHERE `uuid` NOT IN (SELECT DISTINCT `channel_uuid` FROM `channel_priority`); \ No newline at end of file