INSERT IGNORE INTO permissions (code, name, module, created_at) VALUES
('addon.gallery.view', 'Lihat Gallery Assets', 'addon_gallery', NOW()),
('addon.gallery.manage', 'Kelola Gallery Assets', 'addon_gallery', NOW());

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id
FROM roles r
JOIN permissions p ON p.code IN (
  'addon.gallery.view',
  'addon.gallery.manage'
)
WHERE r.code IN ('owner', 'admin', 'kepala_toko');
