INSERT INTO permissions (module, action, slug) VALUES
('stock', 'transfer_view', 'stock.transfer.view'),
('stock', 'transfer_create', 'stock.transfer.create'),
('stock', 'transfer_delete', 'stock.transfer.delete'),
('stock', 'adjust_view', 'stock.adjust.view'),
('stock', 'adjust_create', 'stock.adjust.create'),
('stock', 'adjust_delete', 'stock.adjust.delete')
ON DUPLICATE KEY UPDATE slug = VALUES(slug);

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT 1, id FROM permissions WHERE slug LIKE 'stock.%';

INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT 2, id FROM permissions WHERE slug LIKE 'stock.%';
