diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 289944636..17f7cdf2f 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4090,4 +4090,13 @@ INSERT INTO vn.bankPolicy (id, `ref`, amount, committedFee, nonCommittedFee, ann INSERT INTO vn.ppe (id, amortization, firstAmortizated, lastAmortizated, finished, value, planFk, groupFk, account, endowment, elementAccount, nature, location, discharged, cause, isInvestmentAsset, workerFk, companyFk, description, isDone) VALUES (1, 0.00, '2001-01-01', NULL, NULL, 700.95, 16, 4, '3456000000', '4320000000', '12345', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE LASER ROTATIVO AUTONIVELANTE 500M', NULL), - (2, 0.00, '2001-01-01', NULL, NULL, 400.00, 16, 4, '5678000000', '1230000000', '67891', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE BALANZA Z100 150KILOS', NULL); \ No newline at end of file + (2, 0.00, '2001-01-01', NULL, NULL, 400.00, 16, 4, '5678000000', '1230000000', '67891', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE BALANZA Z100 150KILOS', NULL); + +INSERT IGNORE INTO vn.vehicleType (id, name) + VALUES (1,'vehículo empresa'), + (2, 'furgoneta'), + (3, 'cabeza tractora'), + (4, 'remolque'); + + + \ No newline at end of file diff --git a/db/versions/11394-brownAsparagus/00-firstScript.sql b/db/versions/11394-brownAsparagus/00-firstScript.sql index 77dfab7d3..51034c86b 100644 --- a/db/versions/11394-brownAsparagus/00-firstScript.sql +++ b/db/versions/11394-brownAsparagus/00-firstScript.sql @@ -1,3 +1,4 @@ +USE vn; INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId) VALUES ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'administrative'), ('Vehicle', 'filter', 'READ', 'ALLOW', 'ROLE', 'delivery'), @@ -14,4 +15,22 @@ INSERT INTO salix.ACL (model, property, accessType, permission, principalType, p ('Ppe', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery' ), ('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'administrative'), ('Vehicle', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'delivery'), - ('Vehicle', '__get__active', 'READ', 'ALLOW', 'ROLE', 'employee'); \ No newline at end of file + ('Vehicle', '__get__active', 'READ', 'ALLOW', 'ROLE', 'employee'); + +ALTER TABLE vehicle ADD COLUMN importCooler decimal(10,2) DEFAULT NULL; + + +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'); +ALTER TABLE vehicle ADD COLUMN vehicleTypeFk INT(11) DEFAULT 1; + +ALTER TABLE vehicle ADD CONSTRAINT fk_vehicle_vehicleType FOREIGN KEY (vehicleTypeFk) REFERENCES vehicleType(id); +