query add permission dan menu

mail@pastecode.io avatar
unknown
pgsql
5 months ago
1.1 kB
14
Indexable
INSERT INTO menu_roles ( type, position, parent_id, name, icon, link, sort, "createdAt", "updatedAt") VALUES ( 1, 4, 0, 'Lead Project', 'fa-solid fa-earth-americas', '/lead-project', 153, '2024-03-24 15:45:48.379000 +00:00', '2024-03-24 16:00:02.746000 +00:00');
INSERT INTO menu_roles ( type, position, parent_id, name, icon, link, sort, "createdAt", "updatedAt") VALUES ( 1, 4, 0, 'Lead Unit', 'fa-solid fa-earth-americas', '/lead-unit', 153, '2024-03-24 15:45:48.379000 +00:00', '2024-03-24 16:00:02.746000 +00:00');


-- INSERT untuk Lead Project
INSERT INTO permissions (role_id, menu_id, "createdAt", "updatedAt")
VALUES
(
    17,
    (SELECT id FROM menu_roles WHERE name = 'Lead Project' AND link = '/lead-project'),
    '2024-03-24 15:45:48.379000 +00:00',
    '2024-03-24 16:00:02.746000 +00:00'
);

-- INSERT untuk Lead Unit
INSERT INTO permissions (role_id, menu_id, "createdAt", "updatedAt")
VALUES
(
    17,
    (SELECT id FROM menu_roles WHERE name = 'Lead Unit' AND link = '/lead-unit'),
    '2024-03-24 15:45:48.379000 +00:00',
    '2024-03-24 16:00:02.746000 +00:00'
);
Leave a Comment