From a7b15c2dfce617f01e6d0ae64d0700bddd8ff9de Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 16 Jul 2019 14:48:48 +0200 Subject: [PATCH] fixed dms back unit tests --- db/changes/10060-summer/00-dms.sql | 23 +++++++++++++++++++++++ db/dump/fixtures.sql | 8 ++++---- e2e/dms/temp/file.txt | 1 - 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 db/changes/10060-summer/00-dms.sql delete mode 100644 e2e/dms/temp/file.txt diff --git a/db/changes/10060-summer/00-dms.sql b/db/changes/10060-summer/00-dms.sql new file mode 100644 index 000000000..c06ba22fd --- /dev/null +++ b/db/changes/10060-summer/00-dms.sql @@ -0,0 +1,23 @@ +ALTER TABLE `vn2008`.`gestdoc` +ADD COLUMN `contentType` VARCHAR(100) NULL AFTER `file`; + +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `root`@`%` + SQL SECURITY DEFINER +VIEW `vn`.`dms` AS + SELECT + `g`.`id` AS `id`, + `g`.`gesttip_id` AS `dmsTypeFk`, + `g`.`file` AS `file`, + `g`.`contentType` AS `contentType`, + `g`.`trabajador_id` AS `workerFk`, + `g`.`warehouse_id` AS `warehouseFk`, + `g`.`emp_id` AS `companyFk`, + `g`.`orden` AS `hardCopyNumber`, + `g`.`original` AS `hasFile`, + `g`.`sref` AS `reference`, + `g`.`brief` AS `description`, + `g`.`odbc_date` AS `created` + FROM + `vn2008`.`gestdoc` `g`; diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 5af72a24a..f97148a8e 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1820,11 +1820,11 @@ INSERT INTO `vn`.`dmsType`(`id`, `name`, `path`, `readRoleFk`, `writeRoleFk`, `c (18, 'dua', 'dua', NULL, NULL, 'dua'), (19, 'inmovilizado', 'inmovilizado', NULL, NULL, 'fixedAssets'); -INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`) +INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`) VALUES - (1, 14, '1.pdf', 5, 1, 442, NULL, FALSE, 'Ticket:11', 'Ticket:11 dms for the ticket', CURDATE()), - (2, 5, '2.pdf', 5, 1, 442, 1, TRUE, 'Client:101', 'Client:101 dms for the client', CURDATE()), - (3, 5, '3.pdf', 5, 1, 442, NULL, TRUE, 'Client: 101', 'Client:101 readme', CURDATE()); + (1, 14, '1.txt', 'text/plain', 5, 1, 442, NULL, FALSE, 'Ticket:11', 'Ticket:11 dms for the ticket', CURDATE()), + (2, 5, '2.txt', 'text/plain', 5, 1, 442, 1, TRUE, 'Client:101', 'Client:101 dms for the client', CURDATE()), + (3, 5, '3.txt', 'text/plain', 5, 1, 442, NULL, TRUE, 'Client: 101', 'Client:101 readme', CURDATE()); INSERT INTO `vn`.`ticketDms`(`ticketFk`, `dmsFk`) VALUES diff --git a/e2e/dms/temp/file.txt b/e2e/dms/temp/file.txt deleted file mode 100644 index 5ef648a88..000000000 --- a/e2e/dms/temp/file.txt +++ /dev/null @@ -1 +0,0 @@ -It works! \ No newline at end of file