2025-01-21 14:48:20 +00:00
|
|
|
USE vn;
|
2025-01-23 09:53:53 +00:00
|
|
|
|
2024-12-24 12:01:23 +00:00
|
|
|
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
|
2025-01-20 17:05:33 +00:00
|
|
|
VALUES ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
2025-01-23 09:53:53 +00:00
|
|
|
('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
2025-01-20 17:05:33 +00:00
|
|
|
('Vehicle', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
2025-01-23 09:53:53 +00:00
|
|
|
('Vehicle', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
2025-01-20 17:05:33 +00:00
|
|
|
('Vehicle', 'findById', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
2025-01-23 17:02:53 +00:00
|
|
|
('Vehicle', 'findById', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
|
|
|
('Vehicle', '__get__active', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
2025-01-20 17:05:33 +00:00
|
|
|
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
2025-01-23 09:53:53 +00:00
|
|
|
('Vehicle', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
2025-01-23 17:02:53 +00:00
|
|
|
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
|
|
|
('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
|
|
|
('Vehicle', 'create', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
|
|
|
('Vehicle', 'create', 'WRITE', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
2025-01-20 17:05:33 +00:00
|
|
|
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
2025-01-23 09:53:53 +00:00
|
|
|
('BankPolicy', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
2025-01-21 10:52:09 +00:00
|
|
|
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
2025-01-23 09:53:53 +00:00
|
|
|
('VehicleState', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
2025-01-20 17:05:33 +00:00
|
|
|
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative' ),
|
2025-01-23 09:53:53 +00:00
|
|
|
('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant' ),
|
|
|
|
('VehicleType', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
2025-01-23 17:02:53 +00:00
|
|
|
('DeliveryPoint', 'find', 'READ', 'ALLOW', 'ROLE', 'deliveryAssistant'),
|
|
|
|
('DeliveryPoint', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative');
|
|
|
|
|
2025-01-21 14:48:20 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS vehicleType (
|
|
|
|
id INT(11) PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
name VARCHAR(45) NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
INSERT IGNORE INTO vehicleType (id, name)
|
|
|
|
VALUES (1,'vehículo empresa'),
|
|
|
|
(2, 'furgoneta'),
|
|
|
|
(3, 'cabeza tractora'),
|
|
|
|
(4, 'remolque');
|
|
|
|
|
2025-01-23 09:53:53 +00:00
|
|
|
ALTER TABLE vehicle ADD COLUMN importCooler decimal(10,2) DEFAULT NULL;
|
|
|
|
ALTER TABLE vehicle ADD COLUMN vehicleTypeFk INT(11) DEFAULT 1;
|
2025-01-21 14:48:20 +00:00
|
|
|
ALTER TABLE vehicle ADD CONSTRAINT fk_vehicle_vehicleType FOREIGN KEY (vehicleTypeFk) REFERENCES vehicleType(id);
|
|
|
|
|