-- Creation of init content. Scheme assumed to be empty
-- 
USE `u947463964_etaviaporte` ;

INSERT INTO `applications` (`name`, `slug`, `description`) VALUES ('ETAConsole','console','ETA logistics console for Carriers and Shippers');
INSERT INTO `applications` (`name`, `slug`, `description`) VALUES ('ETADriver','driver','ETA driver application');
INSERT INTO `applications` (`name`, `slug`, `description`) VALUES ('ETAObserverClient','client','ETA observer console for clients');
INSERT INTO `applications` (`name`, `slug`, `description`) VALUES ('ETAObserverWarehouse','warehouse','ETA observer console for warehouse');

-- Roles for ETAConsole application (1)
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (1,'owner', '(ETAConsole): Owner of the company');
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (1,'manager', '(ETAConsole): Manager of the company');
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (1,'driver', '(ETAConsole): Driver user type');
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (1,'staff', '(ETAConsole): Member of the staff');
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (1,'warehouse', '(ETAConsole): Observer type of member');
-- Roles for ETADriver application (2)
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (2,'driver', '(ETADriver): Driver user type');
-- Roles for ETAObserverClient application (3)
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (3,'client', '(ETAObserverClient): Client user type');
-- Roles for ETAObserverWarehouse application (4)
INSERT INTO `roles` (`application_id`,`name`, `description`) VALUES (4,'warehouse', '(ETAObserverWarehouse):Warehouse user type');

-- Permissions for ETAConsole application (1)
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (1,'owner', '(ETAConsole): Compatibility with Legacy while refactor in progress');
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (1,'manager', '(ETAConsole): Compatibility with Legacy while refactor in progress');
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (1,'driver', '(ETAConsole): Compatibility with Legacy while refactor in progress');
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (1,'staff', '(ETAConsole): Compatibility with Legacy while refactor in progress');
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (1,'warehouse', '(ETAConsole): Compatibility with Legacy while refactor in progress');
-- Permissions for ETADriver application (2)
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (2,'driver', '(ETADriver): Compatibility with Legacy while refactor in progress');
-- Permissions for ETAObserverClient application (3)
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (3,'client', '(ETAObserverClient): Compatibility with Legacy while refactor in progress');
-- Permissions for ETAObserverWarehouse application (4)
INSERT INTO `permissions` (`application_id`,`name`, `description`) VALUES (4,'warehouse', '(ETAObserverWarehouse): Compatibility with Legacy while refactor in progress');

-- Role-Permissions link for ETAConsole application (1)
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (1,1);
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (2,2);
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (3,3);
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (4,4);
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (5,5);
-- Role-Permissions link for ETADriver application (2)
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (6,6);
-- Role-Permissions link for ETAObserverClient application (3)
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (7,7);
-- Role-Permissions link for ETAObserverWarehouse application (4)
INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES (8,8);
