-- --------------------------------------------------------
-- Drop foreign keys
--
ALTER TABLE `PERSON`
DROP FOREIGN KEY `person_user_created_by_id_fk`;

ALTER TABLE `PERSON`
DROP FOREIGN KEY  `person_user_last_updated_by_id_fk`;
-- --------------------------------------------------------
-- Agregamos adminitrador del sistema
--
INSERT INTO `PERSON` (`id`, `first_name`, `last_name`,  `avatar`, `person_type`, `active`, `root`, `created_by`, `created_on`) VALUE
('e480d163-5444-4cdf-8989-9eff3550d087', 'Ruben', 'Campos', 'images/avatar-01.png', 'EMPLOYEE', 1, 1, '09ea84b8-b9d1-4a71-adfe-db653b2a9982', NOW());
-- --------------------------------------------------------
--
-- Volcado de datos para la tabla `CAR_DRIVER_USER`
--
INSERT INTO `CAR_DRIVER_USER` (`id`, `username`, `password`, `active`, `root`,  `person_id`,`created_by`,`created_on`) VALUE
('09ea84b8-b9d1-4a71-adfe-db653b2a9982', 'ruben.campos', 'F3DCE366BF20E14FFC2677F203565CA00D781D197E0BA9988BEFD67EF5A9A9D8', 1, 1, 'e480d163-5444-4cdf-8989-9eff3550d087', '09ea84b8-b9d1-4a71-adfe-db653b2a9982', NOW());
-- -------------------------------------------------------------
-- Agregamos todos los permisos existentes al catalo de permisos
--
INSERT INTO `PERMISSION` VALUES ('5a04bf47-8bb2-11ea-850e-0ac1bd2d54fa','syste.user.manager.notification.name','syste.user.manager.notification.description','syste.user.manager.notification.path',50,30,0,1,1,NULL),('5a11e34a-8bb2-11ea-850e-0ac1bd2d54fa','syste.user.manager.notification.add','syste.user.manager.notification.add.description','syste.user.manager.notification.add.path',50,31,0,0,1,'syste.user.manager.notification.name'),('5a11e5f6-8bb2-11ea-850e-0ac1bd2d54fa','syste.user.manager.notification.update','syste.user.manager.notification.update.description','syste.user.manager.notification.update.path',50,32,0,0,1,'syste.user.manager.notification.name'),('5a11e66d-8bb2-11ea-850e-0ac1bd2d54fa','syste.user.manager.notification.delete','syste.user.manager.notification.delete.description','syste.user.manager.notification.delete.path',50,33,0,0,1,'syste.user.manager.notification.name'),('5a1e8fa5-8bb2-11ea-850e-0ac1bd2d54fa','syste.user.manager.notification.active','syste.user.manager.notification.active.description','syste.user.manager.notification.active.path',50,34,0,0,1,NULL),('e5359a79-7a7c-11ea-850e-0ac1bd2d54fa','general.access.name','general.access.description','general.access.path',0,10,1,0,1,NULL),('e535e0b9-7a7c-11ea-850e-0ac1bd2d54fa','dashboard.policy.to.expire.name','dashboard.policy.to.expire.description','dashboard.policy.to.expire.path',10,10,0,0,1,NULL),('e535e1f5-7a7c-11ea-850e-0ac1bd2d54fa','dashboard.past.due.payments.name','dashboard.past.due.payments.description','dashboard.past.due.payments.path',10,20,0,0,1,NULL),('e535e249-7a7c-11ea-850e-0ac1bd2d54fa','dashboard.expired.licenses.name','dashboard.expired.licenses.description','dashboard.expired.licenses.path',10,30,0,0,1,NULL),('e535e288-7a7c-11ea-850e-0ac1bd2d54fa','dashboard.income.of.the.day.name','dashboard.income.of.the.day.description','dashboard.income.of.the.day.path',10,40,0,0,1,NULL),('e535e2c8-7a7c-11ea-850e-0ac1bd2d54fa','dashboard.birthday.anniversary.name','dashboard.birthday.anniversary.description','dashboard.birthday.anniversary.path',10,50,0,0,1,NULL),('e535e312-7a7c-11ea-850e-0ac1bd2d54fa','admin.employee.name','admin.employee.description','admin.employee.path',20,10,0,1,1,NULL),('e535e34a-7a7c-11ea-850e-0ac1bd2d54fa','admin.client.name','admin.client.description','admin.client.path',20,20,0,1,1,NULL),('e535e391-7a7c-11ea-850e-0ac1bd2d54fa','admin.provider.name','admin.provider.description','admin.provider.path',20,30,0,1,1,NULL),('e535e3c7-7a7c-11ea-850e-0ac1bd2d54fa','admin.driver.active.name','admin.driver.active.description','admin.driver.active.path',20,40,0,1,1,NULL),('e535e3ff-7a7c-11ea-850e-0ac1bd2d54fa','admin.driver.on.bench.name','admin.driver.on.bench.description','admin.driver.on.bench.path',20,50,0,1,1,NULL),('e535e435-7a7c-11ea-850e-0ac1bd2d54fa','admin.taxi.name','admin.taxi.description','admin.taxi.path',20,60,0,1,1,NULL),('e535e46a-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.add.sale.name','admin.sale.tab.add.sale.description','admin.sale.tab.add.sale.path',20,70,0,1,1,NULL),('e535e4a6-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.driver.name','admin.sale.tab.driver.description','admin.sale.tab.driver.path',20,80,0,1,1,NULL),('e535e4e6-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.taxi.name','admin.sale.tab.taxi.description','admin.sale.tab.taxi.path',20,90,0,1,1,NULL),('e535e518-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.general.name','admin.sale.tab.general.description','admin.sale.tab.general.path',20,100,0,1,1,NULL),('e535e555-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.external.name','admin.sale.tab.external.description','admin.sale.tab.external.path',20,110,0,1,1,NULL),('e535e591-7a7c-11ea-850e-0ac1bd2d54fa','admin.sanction.name','admin.sanction.description','admin.sanction.path',20,120,0,1,1,NULL),('e535e5c3-7a7c-11ea-850e-0ac1bd2d54fa','admin.to.collect.name','admin.to.collect.description','admin.to.collect.path',20,130,0,1,1,NULL),('e535e5f5-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.car.name','catalog.brand.car.description','catalog.brand.car.path',30,10,0,1,1,NULL),('e535e629-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.product.name','catalog.brand.product.description','catalog.brand.product.path',30,20,0,1,1,NULL),('e535e65f-7a7c-11ea-850e-0ac1bd2d54fa','catalog.color.name','catalog.color.description','catalog.color.path',30,30,0,1,1,NULL),('e535e691-7a7c-11ea-850e-0ac1bd2d54fa','catalog.vehicle.name','catalog.vehicle.description','catalog.vehicle.path',30,40,0,1,1,NULL),('e535e6c3-7a7c-11ea-850e-0ac1bd2d54fa','catalog.product.name','catalog.product.description','catalog.product.path',30,50,0,1,1,NULL),('e535e6f5-7a7c-11ea-850e-0ac1bd2d54fa','catalog.service.name','catalog.service.description','catalog.service.path',30,60,0,1,1,NULL),('e535e727-7a7c-11ea-850e-0ac1bd2d54fa','catalog.holiday.name','catalog.holiday.description','catalog.holiday.path',30,70,0,1,1,NULL),('e535e758-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.invoice.name','stocktaking.invoice.description','stocktaking.invoice.path',40,10,0,1,1,NULL),('e535e789-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.name','stocktaking.service.order.management.description','stocktaking.service.order.management.path',40,20,0,1,1,NULL),('e535e7c4-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.name','stocktaking.service.order.garage.description','stocktaking.service.order.garage.path',40,30,0,1,1,NULL),('e535e7fd-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.create.name','syste.user.create.description','syste.user.create.path',50,10,0,1,1,NULL),('e535e82e-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.manager.name','syste.user.manager.description','syste.user.manager.path',50,20,0,1,1,NULL),('e535e860-7a7c-11ea-850e-0ac1bd2d54fa','report.daily.sale.name','report.daily.sale.description','report.daily.sale.path',60,10,0,1,1,NULL),('e535e89f-7a7c-11ea-850e-0ac1bd2d54fa','report.saving.driver.name','report.saving.driver.description','report.saving.driver.path',60,20,0,1,1,NULL),('e535e8d2-7a7c-11ea-850e-0ac1bd2d54fa','report.daily.money.name','report.daily.money.description','report.daily.money.path',60,30,0,1,1,NULL),('e535e905-7a7c-11ea-850e-0ac1bd2d54fa','report.pay.customer.name','report.pay.customer.description','report.pay.customer.path',60,40,0,1,1,NULL),('e55e5588-7a7c-11ea-850e-0ac1bd2d54fa','admin.employee.add','admin.employee.add.description','admin.employee.add.path',20,11,0,0,1,'admin.employee.name'),('e55e57d2-7a7c-11ea-850e-0ac1bd2d54fa','admin.employee.update','admin.employee.update.description','admin.employee.update.path',20,12,0,0,1,'admin.employee.name'),('e55e583f-7a7c-11ea-850e-0ac1bd2d54fa','admin.employee.delete','admin.employee.delete.description','admin.employee.delete.path',20,13,0,0,1,'admin.employee.name'),('e55e5881-7a7c-11ea-850e-0ac1bd2d54fa','admin.client.add','admin.client.add.description','admin.client.add.path',20,21,0,0,1,'admin.client.name'),('e55e58c0-7a7c-11ea-850e-0ac1bd2d54fa','admin.client.update','admin.client.update.description','admin.client.update.path',20,22,0,0,1,'admin.client.name'),('e55e58fb-7a7c-11ea-850e-0ac1bd2d54fa','admin.client.delete','admin.client.delete.description','admin.client.delete.path',20,23,0,0,1,'admin.client.name'),('e55e5966-7a7c-11ea-850e-0ac1bd2d54fa','admin.provider.add','admin.provider.add.description','admin.provider.add.path',20,31,0,0,1,'admin.provider.name'),('e55e59a0-7a7c-11ea-850e-0ac1bd2d54fa','admin.provider.update','admin.provider.update.description','admin.provider.update.path',20,32,0,0,1,'admin.provider.name'),('e55e59f3-7a7c-11ea-850e-0ac1bd2d54fa','admin.provider.delete','admin.provider.delete.description','admin.provider.delete.path',20,33,0,0,1,'admin.provider.name'),('e55e5a2b-7a7c-11ea-850e-0ac1bd2d54fa','admin.driver.active.add','admin.driver.active.add.description','admin.driver.active.add.path',20,41,0,0,1,'admin.driver.active.name'),('e55e5a6f-7a7c-11ea-850e-0ac1bd2d54fa','admin.driver.active.update','admin.driver.active.update.description','admin.driver.active.update.path',20,42,0,0,1,'admin.driver.active.name'),('e55e5aa9-7a7c-11ea-850e-0ac1bd2d54fa','admin.driver.active.delete','admin.driver.active.delete.description','admin.driver.active.delete.path',20,43,0,0,1,'admin.driver.active.name'),('e55e5ae1-7a7c-11ea-850e-0ac1bd2d54fa','admin.driver.on.bench.add','admin.driver.on.bench.add.description','admin.driver.on.bench.add.path',20,51,0,0,1,'admin.driver.on.bench.name'),('e55e5b19-7a7c-11ea-850e-0ac1bd2d54fa','admin.taxi.add','admin.taxi.add.description','admin.taxi.add.path',20,61,0,0,1,'admin.taxi.name'),('e55e5b5a-7a7c-11ea-850e-0ac1bd2d54fa','admin.taxi.update','admin.taxi.update.description','admin.taxi.update.path',20,62,0,0,1,'admin.taxi.name'),('e55e5b8f-7a7c-11ea-850e-0ac1bd2d54fa','admin.taxi.delete','admin.taxi.delete.description','admin.taxi.delete.path',20,63,0,0,1,'admin.taxi.name'),('e55e5bc5-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.add.sale.popup.btn.add','admin.sale.tab.add.sale.popup.btn.add.description','admin.sale.tab.add.sale.popup.btn.add.path',20,71,0,0,1,'admin.sale.tab.add.sale.name'),('e55e5bff-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.add.sale.popup.btn.update','admin.sale.tab.add.sale.popup.btn.update.description','admin.sale.tab.add.sale.popup.btn.update.path',20,72,0,0,1,'admin.sale.tab.add.sale.name'),('e55e5c3a-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.add.sale.popup.btn.show','admin.sale.tab.add.sale.popup.btn.show.description','admin.sale.tab.add.sale.popup.btn.show.path',20,73,0,0,1,'admin.sale.tab.add.sale.name'),('e55e5c76-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.add.sale.total.daily','admin.sale.tab.add.sale.total.daily.description','admin.sale.tab.add.sale.total.daily.path',20,74,0,0,1,'admin.sale.tab.add.sale.name'),('e55e5cb1-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.add.sale.total.monthly','admin.sale.tab.add.sale.total.monthly.description','admin.sale.tab.add.sale.total.monthly.path',20,75,0,0,1,'admin.sale.tab.add.sale.name'),('e55e5cec-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.driver.delete','admin.sale.tab.driver.delete.description','admin.sale.tab.driver.delete.path',20,81,0,0,1,'admin.sale.tab.driver.name'),('e55e5d23-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.driver.print','admin.sale.tab.driver.print.description','admin.sale.tab.driver.print.path',20,82,0,0,1,'admin.sale.tab.driver.name'),('e55e5d59-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.driver.not.print','admin.sale.tab.driver.not.print.description','admin.sale.tab.driver.not.print.path',20,83,0,0,1,'admin.sale.tab.driver.name'),('e55e5d90-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.taxi.delete','admin.sale.tab.taxi.delete.description','admin.sale.tab.taxi.delete.path',20,91,0,0,1,'admin.sale.tab.taxi.name'),('e55e5dc8-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.taxi.print','admin.sale.tab.taxi.print.description','admin.sale.tab.taxi.print.path',20,92,0,0,1,'admin.sale.tab.taxi.name'),('e55e5e0b-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.taxi.not.print','admin.sale.tab.taxi.not.print.description','admin.sale.tab.taxi.not.print.path',20,93,0,0,1,'admin.sale.tab.taxi.name'),('e55e5e44-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.general.delete','admin.sale.tab.general.delete.description','admin.sale.tab.general.delete.path',20,101,0,0,1,'admin.sale.tab.general.name'),('e55e5e7a-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.general.print','admin.sale.tab.general.print.description','admin.sale.tab.general.print.path',20,102,0,0,1,'admin.sale.tab.general.name'),('e55e5eb0-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.general.not.print','admin.sale.tab.general.not.print.description','admin.sale.tab.general.not.print.path',20,103,0,0,1,'admin.sale.tab.general.name'),('e55e5eec-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.external.add','admin.sale.tab.external.add.description','admin.sale.tab.external.add.path',20,111,0,0,1,'admin.sale.tab.external.name'),('e55e5f24-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.external.authorize','admin.sale.tab.external.authorize.description','admin.sale.tab.external.authorize.path',20,112,0,0,1,'admin.sale.tab.external.name'),('e55e5f5c-7a7c-11ea-850e-0ac1bd2d54fa','admin.sale.tab.external.borrar','admin.sale.tab.external.borrar.description','admin.sale.tab.external.borrar.path',20,113,0,0,1,'admin.sale.tab.external.name'),('e55e5f9a-7a7c-11ea-850e-0ac1bd2d54fa','admin.sanction.add','admin.sanction.add.description','admin.sanction.add.path',20,121,0,0,1,'admin.sanction.name'),('e55e5fcf-7a7c-11ea-850e-0ac1bd2d54fa','admin.sanction.delete','admin.sanction.delete.description','admin.sanction.delete.path',20,122,0,0,1,'admin.sanction.name'),('e55e6002-7a7c-11ea-850e-0ac1bd2d54fa','admin.to.collect.update','admin.to.collect.update.description','admin.to.collect.update.path',20,131,0,0,1,'admin.to.collect.name'),('e55e6038-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.car.add','catalog.brand.car.add.description','catalog.brand.car.add.path',30,11,0,0,1,'catalog.brand.car.name'),('e55e606c-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.car.update','catalog.brand.car.update.description','catalog.brand.car.update.path',30,12,0,0,1,'catalog.brand.car.name'),('e55e60a5-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.car.delete','catalog.brand.car.delete.description','catalog.brand.car.delete.path',30,13,0,0,1,'catalog.brand.car.name'),('e55e60d9-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.product.add','catalog.brand.product.add.description','catalog.brand.product.add.path',30,21,0,0,1,'catalog.brand.product.name'),('e55e6113-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.product.update','catalog.brand.product.update.description','catalog.brand.product.update.path',30,22,0,0,1,'catalog.brand.product.name'),('e55e614b-7a7c-11ea-850e-0ac1bd2d54fa','catalog.brand.product.delete','catalog.brand.product.delete.description','catalog.brand.product.delete.path',30,23,0,0,1,'catalog.brand.product.name'),('e55e617f-7a7c-11ea-850e-0ac1bd2d54fa','catalog.color.add','catalog.color.add.description','catalog.color.add.path',30,31,0,0,1,'catalog.color.name'),('e55e61b4-7a7c-11ea-850e-0ac1bd2d54fa','catalog.color.update','catalog.color.update.description','catalog.color.update.path',30,32,0,0,1,'catalog.color.name'),('e55e61e7-7a7c-11ea-850e-0ac1bd2d54fa','catalog.color.delete','catalog.color.delete.description','catalog.color.delete.path',30,33,0,0,1,'catalog.color.name'),('e55e621c-7a7c-11ea-850e-0ac1bd2d54fa','catalog.vehicle.add','catalog.vehicle.add.description','catalog.vehicle.add.path',30,41,0,0,1,'catalog.vehicle.name'),('e55e6250-7a7c-11ea-850e-0ac1bd2d54fa','catalog.vehicle.update','catalog.vehicle.update.description','catalog.vehicle.update.path',30,42,0,0,1,'catalog.vehicle.name'),('e55e6285-7a7c-11ea-850e-0ac1bd2d54fa','catalog.vehicle.delete','catalog.vehicle.delete.description','catalog.vehicle.delete.path',30,43,0,0,1,'catalog.vehicle.name'),('e55e62b7-7a7c-11ea-850e-0ac1bd2d54fa','catalog.product.add','catalog.product.add.description','catalog.product.add.path',30,51,0,0,1,'catalog.product.name'),('e55e62e9-7a7c-11ea-850e-0ac1bd2d54fa','catalog.product.update','catalog.product.update.description','catalog.product.update.path',30,52,0,0,1,'catalog.product.name'),('e55e6320-7a7c-11ea-850e-0ac1bd2d54fa','catalog.product.delete','catalog.product.delete.description','catalog.product.delete.path',30,53,0,0,1,'catalog.product.name'),('e55e6375-7a7c-11ea-850e-0ac1bd2d54fa','catalog.service.add','catalog.service.add.description','catalog.service.add.path',30,61,0,0,1,'catalog.service.name'),('e55e63ad-7a7c-11ea-850e-0ac1bd2d54fa','catalog.service.update','catalog.service.update.description','catalog.service.update.path',30,62,0,0,1,'catalog.service.name'),('e55e63e0-7a7c-11ea-850e-0ac1bd2d54fa','catalog.service.delete','catalog.service.delete.description','catalog.service.delete.path',30,63,0,0,1,'catalog.service.name'),('e55e6414-7a7c-11ea-850e-0ac1bd2d54fa','catalog.holiday.add','catalog.holiday.add.description','catalog.holiday.add.path',30,71,0,0,1,'catalog.holiday.name'),('e55e6445-7a7c-11ea-850e-0ac1bd2d54fa','catalog.holiday.update','catalog.holiday.update.description','catalog.holiday.update.path',30,72,0,0,1,'catalog.holiday.name'),('e55e6478-7a7c-11ea-850e-0ac1bd2d54fa','catalog.holiday.delete','catalog.holiday.delete.description','catalog.holiday.delete.path',30,73,0,0,1,'catalog.holiday.name'),('e55e64ae-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.invoice.add','stocktaking.invoice.add.description','stocktaking.invoice.add.path',40,11,0,0,1,'stocktaking.invoice.name'),('e55e68e0-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.invoice.update','stocktaking.invoice.update.description','stocktaking.invoice.update.path',40,12,0,0,1,'stocktaking.invoice.name'),('e55e6943-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.invoice.delete','stocktaking.invoice.delete.description','stocktaking.invoice.delete.path',40,13,0,0,1,'stocktaking.invoice.name'),('e55e6980-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.add','stocktaking.service.order.management.add.description','stocktaking.service.order.management.add.path',40,21,0,0,1,'stocktaking.service.order.management.name'),('e55e69c8-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.update','stocktaking.service.order.management.update.description','stocktaking.service.order.management.update.path',40,22,0,0,1,'stocktaking.service.order.management.name'),('e55e6a0c-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.delete','stocktaking.service.order.management.delete.description','stocktaking.service.order.management.delete.path',40,23,0,0,1,'stocktaking.service.order.management.name'),('e55e6a4e-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.search','stocktaking.service.order.management.search.description','stocktaking.service.order.management.search.path',40,24,0,0,1,'stocktaking.service.order.management.name'),('e55e6a91-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.actions.btn.authorize','stocktaking.service.order.management.actions.btn.authorize.description','stocktaking.service.order.management.actions.btn.authorize.path',40,25,0,0,1,'stocktaking.service.order.management.name'),('e55e6ad8-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.management.actions.btn.delete','stocktaking.service.order.management.actions.btn.delete.description','stocktaking.service.order.management.actions.btn.delete.path',40,26,0,0,1,'stocktaking.service.order.management.name'),('e55e6b1a-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.add','stocktaking.service.order.garage.add.description','stocktaking.service.order.garage.add.path',40,31,0,0,1,'stocktaking.service.order.garage.name'),('e55e6b59-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.update','stocktaking.service.order.garage.update.description','stocktaking.service.order.garage.update.path',40,32,0,0,1,'stocktaking.service.order.garage.name'),('e55e6b97-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.delete','stocktaking.service.order.garage.delete.description','stocktaking.service.order.garage.delete.path',40,33,0,0,1,'stocktaking.service.order.garage.name'),('e55e6bd2-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.search','stocktaking.service.order.garage.search.description','stocktaking.service.order.garage.search.path',40,34,0,0,1,'stocktaking.service.order.garage.name'),('e55e6c0b-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.actions.btn.progress','stocktaking.service.order.garage.actions.btn.progress.description','stocktaking.service.order.garage.actions.btn.progress.path',40,35,0,0,1,'stocktaking.service.order.garage.name'),('e55e6c53-7a7c-11ea-850e-0ac1bd2d54fa','stocktaking.service.order.garage.actions.btn.finish','stocktaking.service.order.garage.actions.btn.finish.description','stocktaking.service.order.garage.actions.btn.finish.path',40,36,0,0,1,'stocktaking.service.order.garage.name'),('e55e6c95-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.create.add','syste.user.create.add.description','syste.user.create.add.path',50,11,0,0,1,'syste.user.create.name'),('e55e6ccd-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.manager.password.update','syste.user.manager.password.update.description','syste.user.manager.password.update.path',50,21,0,0,1,'syste.user.manager.name'),('e55e6d07-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.manager.inactive.update','syste.user.manager.inactive.update.description','syste.user.manager.inactive.update.path',50,22,0,0,1,'syste.user.manager.name'),('e55e6d41-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.manager.reactive.update','syste.user.manager.reactive.update.description','syste.user.manager.reactive.update.path',50,23,0,0,1,'syste.user.manager.name'),('e55e6d7b-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.manager.delete.update','syste.user.manager.delete.update.description','syste.user.manager.delete.update.path',50,24,0,0,1,'syste.user.manager.name'),('e55e6db3-7a7c-11ea-850e-0ac1bd2d54fa','syste.user.manager.update.permission.update','syste.user.manager.update.permission.update.description','syste.user.manager.update.permission.update.path',50,25,0,0,1,'syste.user.manager.name'),('e55e6def-7a7c-11ea-850e-0ac1bd2d54fa','report.daily.sale.export','report.daily.sale.export.description','report.daily.sale.export.path',60,11,0,0,1,'report.daily.sale.name'),('e55e6e27-7a7c-11ea-850e-0ac1bd2d54fa','report.saving.driver.export','report.saving.driver.export.description','report.saving.driver.export.path',60,21,0,0,1,'report.saving.driver.name'),('e55e6e5f-7a7c-11ea-850e-0ac1bd2d54fa','report.daily.money.export','report.daily.money.export.description','report.daily.money.export.path',60,31,0,0,1,'report.daily.money.name'),('e55e6e96-7a7c-11ea-850e-0ac1bd2d54fa','report.pay.customer.export','report.pay.customer.export.description','report.pay.customer.export.path',60,41,0,0,1,'report.pay.customer.name');
INSERT INTO `PERMISSION`(id,name,description,menu_path,left_to_right_order,top_to_bottom_order,general_access,application_menu,active,parent_name)
VALUES 
-- entradas
('71279e30-84db-11eb-88b3-d02e75be5983','admin.payment.in.name','admin.payment.in.description','admin.payment.in.path',20,140,0,1,1,NULL),
('916d694e-84dc-11eb-88b3-d02e75be5983','admin.payment.in.add','admin.payment.in.add.description','admin.payment.in.add.path',20,141,0,0,1,'admin.payment.in.name'),
('989c3ef2-84dc-11eb-88b3-d02e75be5983','admin.payment.in.delete','admin.payment.in.delete.description','admin.payment.in.delete.path',20,142,0,0,1,'admin.payment.in.name'),
-- gastos generales
('dbe9580c-84dc-11eb-88b3-d02e75be5983','admin.payment.out.name','admin.payment.out.description','admin.payment.out.path',20,150,0,1,1,NULL),
('98a34010-84de-11eb-88b3-d02e75be5983','admin.payment.out.add','admin.payment.out.add.description','admin.payment.out.add.path',20,151,0,0,1,'admin.payment.out.name'),
('9e995b6c-84de-11eb-88b3-d02e75be5983','admin.payment.out.delete','admin.payment.out.delete.description','admin.payment.out.delete.path',20,152,0,0,1,'admin.payment.out.name'),
-- caja general
('8752d452-85b4-11eb-bcdb-809f9a2a0390','admin.stable.general.box.name','admin.stable.general.box.description','admin.stable.general.box.path',20,160,0,1,1,NULL),
('5ee26a32-85b4-11eb-bcdb-809f9a2a0390','admin.stable.general.box.add','admin.stable.general.box.add.description','admin.stable.general.box.add.path',20,161,0,0,1,'admin.stable.general.box.name'),
('6bb9509a-85b4-11eb-bcdb-809f9a2a0390','admin.stable.general.box.delete','admin.stable.general.box.delete.description','admin.stable.general.box.delete.path',20,162,0,0,1,'admin.stable.general.box.name'),
-- caja chica
('f01fd04e-8851-11eb-a6e3-ef479517b33e','admin.stable.small.box.name','admin.stable.small.box.description','admin.stable.small.box.path',20,160,0,1,1,NULL),
('f87d48e8-8851-11eb-a6e3-ef479517b33e','admin.stable.small.box.add','admin.stable.small.box.add.description','admin.stable.small.box.add.path',20,161,0,0,1,'admin.stable.small.box.name'),
('fe56d4b4-8851-11eb-a6e3-ef479517b33e','admin.stable.small.box.delete','admin.stable.small.box.delete.description','admin.stable.small.box.delete.path',20,162,0,0,1,'admin.stable.small.box.name'),
-- corte caja chica
('fb3893b1-91d7-11eb-94c4-8cc84ba27d44','admin.stable.small.box.daily.cash.cut.name','admin.stable.small.box.daily.cash.cut.description','admin.stable.small.box.daily.cash.cut.path',20,170,0,1,1,NULL),
('03a9d160-91d8-11eb-94c4-8cc84ba27d44','admin.stable.small.box.daily.cash.cut.add','admin.stable.small.box.daily.cash.cut.add.description','admin.stable.small.box.daily.cash.cut.add.path',20,171,0,0,1,'admin.stable.small.box.daily.cash.cut.name'),
('09d05977-91d8-11eb-94c4-8cc84ba27d44','admin.stable.small.box.daily.cash.cut.delete','admin.stable.small.box.daily.cash.cut.delete.description','admin.stable.small.box.daily.cash.cut.delete.path',20,172,0,0,1,'admin.stable.small.box.daily.cash.cut.name'),
-- tab inicios
('e6ac9d65-a479-11eb-9f69-8cc84ba27d44','admin.sale.tab.start','admin.sale.tab.start.description','admin.sale.tab.start.path',20,114,0,1,1,'admin.sale.tab.general.name'),
('4eef68d5-a47b-11eb-9f69-8cc84ba27d44','admin.sale.tab.start.auth','admin.sale.tab.start.auth.description','admin.sale.tab.start.auth.path',20,115,0,1,1,'admin.sale.tab.general.name'),
('7f6d51ee-a47e-11eb-9f69-8cc84ba27d44','admin.sale.tab.start.delete','admin.sale.tab.start.delete.descriptio','admin.sale.tab.start.delete.path',20,116,0,1,1,'admin.sale.tab.general.name'),
-- system properties
('650172b0-c61a-11eb-aa96-8cc84ba27d44','syste.properties.name','syste.properties.description','syste.properties.path',50,40,0,0,1,null),
-- fee in dashboard and sales
('cdf50236-c715-11eb-94ce-8cc84ba27d44','admin.sale.tab.add.sale.fee','admin.sale.tab.add.sale.fee.description','admin.sale.tab.add.sale.fee.path',20,76,0,0,1,'admin.sale.tab.add.sale.name'),
('dc59d745-ca25-11eb-8e18-8cc84ba27d44','admin.sale.tab.add.sale.fee.delete','admin.sale.tab.add.sale.fee.delete.description','admin.sale.tab.add.sale.fee.delete.path',20,77,0,0,1,'admin.sale.tab.add.sale.name'),
-- GOOGLE drive
('1a571fcc-cfce-4599-b59c-5d5c4813e5db', 'report.google.drive.name', 'report.google.drive.description', 'report.google.drive.path', 60, 32, 0, 1, 1, NULL);
-- -----------------------------------------------------------
-- agregamos los permisos al usuario adminitrador del sistema
--
INSERT INTO `USER_HAS_PERMISSION` (`id_user`,`id_permission`)
SELECT '09ea84b8-b9d1-4a71-adfe-db653b2a9982',`id`
FROM `PERMISSION`;
-- --------------------------------------------------------
--
-- Alta de datos para la tabla `SYSTEM_PROPERTY`
--
INSERT INTO `SYSTEM_PROPERTY` (id, property_name, property_value, created_by, created_on)
VALUE(UUID(), 'FEE', '50', '09ea84b8-b9d1-4a71-adfe-db653b2a9982', NOW());
INSERT INTO SYSTEM_PROPERTY VALUES (UUID(), 'LIMIT_KM' , 10000, '09ea84b8-b9d1-4a71-adfe-db653b2a9982', 
CURDATE(), NULL, NULL);
-- --------------------------------------------------------
-- Apply changes
--
COMMIT;
-- --------------------------------------------------------
-- Add foreign keys
--
ALTER TABLE `PERSON`
ADD CONSTRAINT `person_user_created_by_id_fk` 
       FOREIGN KEY (`created_by`) REFERENCES `CAR_DRIVER_USER`(`id`)
            ON UPDATE CASCADE
            ON DELETE RESTRICT;

ALTER TABLE `PERSON`
ADD CONSTRAINT `person_user_last_updated_by_id_fk` 
       FOREIGN KEY (`last_updated_by`) REFERENCES `CAR_DRIVER_USER`(`id`)
            ON UPDATE CASCADE
            ON DELETE RESTRICT;
