Forum categories

работодатели не видят категории

копируем права группы через SQL запрос

webitproff
webitproff • 2025-08-19 20:14 #351

запрос для копирования прав группы 4 в группу 7, чтобы не создавались дубликаты

бывает такое, решаем так

 

INSERT INTO `cot_auth` (`auth_groupid`, `auth_code`, `auth_option`, `auth_rights`, `auth_rights_lock`, `auth_setbyuserid`)
SELECT 7, `auth_code`, `auth_option`, `auth_rights`, `auth_rights_lock`, `auth_setbyuserid`
FROM `cot_auth`
WHERE `auth_groupid` = 4
  AND NOT EXISTS (
      SELECT 1 FROM `cot_auth` AS t
      WHERE t.`auth_groupid` = 7
        AND t.`auth_code` = `cot_auth`.`auth_code`
        AND t.`auth_option` = `cot_auth`.`auth_option`
  );
🗿

🧙‍♂️ Well met, good traveler! Fate has guided your steps to our humble realm. Here, wise sages and masters of the coding craft ⚒️📜 gather to unravel the mysteries of the code ✨⚙️, share their knowledge, and add new chapters to our chronicles.
⬅️ To the left lie ancient scrolls 📚 filled with forgotten wisdom. ⬆️ Straight ahead, friendly folk offer counsel 💬 to those in need. ➡️ To the right, you may become a chronicler ✍️ yourself, sharing your craft and leaving words of wisdom for those yet to come.
📝 Delay no longer—tell us the name by which you are known, complete the rite of registration 🛡️, and join our fellowship!
🏰 Our brotherhood holds no secret initiation, yet many halls remain closed to wandering guests, for some knowledge 💎 is reserved for those who choose to walk this path beside us.