START TRANSACTION;

INSERT IGNORE INTO permissions (code, name, module, created_at) VALUES
('dashboard.login_logs.view', 'Lihat Login Logs Dashboard', 'dashboard', NOW()),
('contribution.agents.view', 'Lihat Kontribusi Agen', 'contribution', NOW());

DELETE FROM role_permissions
WHERE permission_id IN (
  SELECT id
  FROM (
    SELECT id
    FROM permissions
    WHERE code IN ('dashboard.view_sensitive_cards', 'dashboard.view_dept_contribution')
  ) AS legacy_dashboard_permissions
);

DELETE FROM permissions
WHERE code IN ('dashboard.view_sensitive_cards', 'dashboard.view_dept_contribution');

COMMIT;
