Skip to content

Instantly share code, notes, and snippets.

@robzlabz
Last active September 8, 2026 11:54
Show Gist options
  • Select an option

  • Save robzlabz/d45c225a7d1adea19ba6785f8fdf4698 to your computer and use it in GitHub Desktop.

Select an option

Save robzlabz/d45c225a7d1adea19ba6785f8fdf4698 to your computer and use it in GitHub Desktop.
Motmaina ACP - RBAC Menus, Website Features & Permissions Seed (sidebar2.sql)
-- =============================================================================
-- Migration: Remove Legacy "Immediate Consultations" Menu (TF-887)
-- File: sidebar2.sql
--
-- Removes the legacy booking-log menu item (acp/consultations/immediateConsultations),
-- its RBAC menu-action mappings, and associated role permissions.
-- Safe and idempotent to execute multiple times.
-- =============================================================================
SET NAMES utf8mb4;
-- 1) Remove role permissions referencing the legacy menu.
DELETE FROM `rbac_roles_permissions`
WHERE `Menu_ID` = (SELECT `Id` FROM `rbac_menus` WHERE `Link` = 'acp/consultations/immediateConsultations' LIMIT 1);
-- 2) Remove menu-action mappings for the legacy menu.
DELETE FROM `rbac_menu_actions`
WHERE `Menu_ID` = (SELECT `Id` FROM `rbac_menus` WHERE `Link` = 'acp/consultations/immediateConsultations' LIMIT 1);
-- 3) Remove the legacy menu row itself.
DELETE FROM `rbac_menus`
WHERE `Link` = 'acp/consultations/immediateConsultations';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment