-- Permissões do módulo E-commerce
INSERT IGNORE INTO permissions (name) VALUES
('ecommerce.read'),
('ecommerce.create'),
('ecommerce.update'),
('ecommerce.delete');

-- Vincular permissões à role admin (se existir)
INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id
FROM roles r
CROSS JOIN permissions p
WHERE r.name = 'admin'
AND p.name IN ('ecommerce.read', 'ecommerce.create', 'ecommerce.update', 'ecommerce.delete');

