From bbc5193970d4f4590d9241b5c05f23665e8ba2e0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 7 Aug 2020 14:35:20 +0200 Subject: [PATCH 1/3] #2381 First working version --- db/Dockerfile | 16 ++++++++-------- db/docker/docker-boot.sh | 3 ++- db/docker/docker-init.sh | 1 - db/docker/docker.cnf | 2 -- db/dump/fixtures.sql | 2 -- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/db/Dockerfile b/db/Dockerfile index 60e25319f3..00d54993af 100644 --- a/db/Dockerfile +++ b/db/Dockerfile @@ -1,4 +1,4 @@ -FROM mysql:8.0.18 +FROM mariadb:10.4.13 ENV MYSQL_ROOT_PASSWORD root ENV TZ Europe/Madrid @@ -7,9 +7,9 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install -y --no-install-recommends curl ca-certificates \ && curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \ - && echo "deb http://apt.verdnatura.es/ stretch main" > /etc/apt/sources.list.d/vn.list \ + && echo "deb http://apt.verdnatura.es/ jessie main" > /etc/apt/sources.list.d/vn.list \ && apt-get update \ - && apt-get install -y vn-mysql libmysqlclient21 \ + && apt-get install -y vn-mariadb \ && apt-get purge -y --auto-remove curl ca-certificates \ && rm -rf /var/lib/apt/lists/* @@ -19,16 +19,16 @@ COPY docker/docker-init.sh docker/docker-start.sh /usr/local/bin/ RUN mkdir /mysql-data \ && chown -R mysql:mysql /mysql-data -WORKDIR /docker-entrypoint-initdb.d +COPY dump /docker-boot/dump +COPY changes /docker-boot/changes +COPY import-changes.sh config.ini /docker-boot/ -COPY dump dump COPY docker/docker-boot.sh /docker-entrypoint-initdb.d/ -COPY changes import/changes -COPY import-changes.sh config.ini import/ ARG STAMP=unknown RUN gosu mysql docker-init.sh mysqld \ - && rm -rf /docker-entrypoint-initdb.d/* + && rm -rf /docker-entrypoint-initdb.d/* \ + && rm -rf /docker-boot USER mysql ENTRYPOINT ["docker-start.sh"] diff --git a/db/docker/docker-boot.sh b/db/docker/docker-boot.sh index 6a0d17c696..5e8ad4c6c0 100755 --- a/db/docker/docker-boot.sh +++ b/db/docker/docker-boot.sh @@ -1,5 +1,6 @@ #!/bin/bash +cd /docker-boot export MYSQL_PWD=root mysql_import() { @@ -11,7 +12,7 @@ mysql_import() { mysql_import dump/structure.sql mysql_import dump/mysqlPlugins.sql mysql_import dump/dumpedFixtures.sql -import/import-changes.sh +./import-changes.sh mysql_import dump/fixtures.sql echo "[INFO] -> Import finished" diff --git a/db/docker/docker-init.sh b/db/docker/docker-init.sh index 19d13a15d3..f2c9d58d7a 100755 --- a/db/docker/docker-init.sh +++ b/db/docker/docker-init.sh @@ -13,5 +13,4 @@ docker_setup_db docker_process_init_files /docker-entrypoint-initdb.d/* -mysql_expire_root_user docker_temp_server_stop diff --git a/db/docker/docker.cnf b/db/docker/docker.cnf index 1a0241487a..be79ecf69b 100644 --- a/db/docker/docker.cnf +++ b/db/docker/docker.cnf @@ -2,9 +2,7 @@ innodb_log_file_size = 4M innodb_autoextend_increment = 4 innodb_page_size = 8K -innodb_default_row_format = COMPACT log_bin_trust_function_creators = ON datadir = /mysql-data sql_mode = NO_ENGINE_SUBSTITUTION -innodb_temp_data_file_path = /tmp/ibtmp1:12M:autoextend skip-log-bin diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 9aaae957b2..e4d266ed82 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1,8 +1,6 @@ CREATE SCHEMA IF NOT EXISTS `vn2008`; CREATE SCHEMA IF NOT EXISTS `tmp`; -ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; - ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1; ALTER TABLE `vn`.`address` AUTO_INCREMENT = 1; ALTER TABLE `vn`.`zoneGeo` AUTO_INCREMENT = 1; From 6abd707a6db0345f075f5feae8980b54f7be72f0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 21 Sep 2020 19:16:51 +0200 Subject: [PATCH 2/3] Tests fixed --- modules/client/back/methods/client/specs/consumption.spec.js | 2 +- modules/ticket/back/methods/ticket-request/specs/filter.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/client/back/methods/client/specs/consumption.spec.js b/modules/client/back/methods/client/specs/consumption.spec.js index 30a0572b3c..f70c093707 100644 --- a/modules/client/back/methods/client/specs/consumption.spec.js +++ b/modules/client/back/methods/client/specs/consumption.spec.js @@ -24,7 +24,7 @@ describe('client consumption() filter', () => { where: { clientFk: 101 }, - order: 'itemTypeFk, itemName, itemSize' + order: 'itemFk' }; const result = await app.models.Client.consumption(ctx, filter); diff --git a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js index 175bf9c1a3..68d7601e42 100644 --- a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js @@ -66,7 +66,7 @@ describe('ticket-request filter()', () => { it('should return the ticket request matching the warehouse ID', async() => { let ctx = {req: {accessToken: {userId: 9}}, args: {warehouse: 1}}; - let result = await app.models.TicketRequest.filter(ctx); + let result = await app.models.TicketRequest.filter(ctx, {order: 'id'}); let requestId = result[0].id; expect(requestId).toEqual(3); From 2d1cf566f8ed85dd93712020ad13abe4074929ee Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 21 Sep 2020 22:54:36 +0200 Subject: [PATCH 3/3] All tests fixed --- modules/order/front/main/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/order/front/main/index.html b/modules/order/front/main/index.html index aad40488e4..d622fea38b 100644 --- a/modules/order/front/main/index.html +++ b/modules/order/front/main/index.html @@ -3,7 +3,7 @@ url="Orders/filter" limit="20" data="orders" - order="landed DESC, clientFk"> + order="landed DESC, clientFk, id DESC">