-- Expense module permissions (run once on existing databases)
INSERT INTO permissions (module, action, slug) VALUES
('expenses', 'view', 'expenses.view'),
('expenses', 'create', 'expenses.create'),
('expenses', 'edit', 'expenses.edit'),
('expenses', 'delete', 'expenses.delete')
ON DUPLICATE KEY UPDATE slug = VALUES(slug);

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT 1, id FROM permissions WHERE module = 'expenses';

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT 2, id FROM permissions WHERE module = 'expenses';
