From 776c4819908805507ae9d7b5d3c89d3c829b08a4 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 6 May 2020 12:47:53 -0400 Subject: Invalid SQL in db init script MySQL allows AUTO_INCREMENT to take args indicating initial value and offset. MariaDB AUTO_INCREMENT is not as flexible - you can specify initial value , but offset is a system-wide parameter (default 1, but can be overridden in my.conf config file). Changed database script to use AUTO_INCREMENT without (0,100), which will cause those fields to start at value 0 and increment by 1. Change-Id: Icc6793290082d455f9de1bd838a6ad8d71d66afa Issue-ID: CCSDK-2360 Signed-off-by: Dan Timoney --- ms/neng/src/main/docker/Dockerfile | 5 +++++ .../db/changelog/scripts/rel_18_10/create_base_tables.sql | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ms/neng/src/main/docker/Dockerfile b/ms/neng/src/main/docker/Dockerfile index e7dc93b3..6f42eaec 100644 --- a/ms/neng/src/main/docker/Dockerfile +++ b/ms/neng/src/main/docker/Dockerfile @@ -31,6 +31,11 @@ VOLUME /opt/etc ADD opt/etc/ /opt/etc/ #ADD /opt/aai/ /opt/aai/ ADD startService.sh /startService.sh +RUN addgroup -S ccsdk && adduser -S ccsdk -G ccsdk +RUN chown ccsdk:ccsdk /startService.sh +RUN chown -R ccsdk:ccsdk /opt +RUN chmod go+w /tmp RUN chmod 700 /startService.sh +USER ccsdk ENTRYPOINT bash /startService.sh EXPOSE 8080 diff --git a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql index afb37437..650051a5 100644 --- a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql +++ b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql @@ -1,7 +1,7 @@ --liquibase formatted sql --changeset template_table:18_10.create_tables_p1.sql -CREATE TABLE GENERATED_NAME (GENERATED_NAME_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100), +CREATE TABLE GENERATED_NAME (GENERATED_NAME_ID INTEGER PRIMARY KEY AUTO_INCREMENT, EXTERNAL_ID VARCHAR(500) NOT NULL COMMENT 'Key sent by SDNC', SEQUNCE_NUMBER INTEGER COMMENT 'Sequence number used for this name', SEQUENCE_NUMBER_ENC VARCHAR(100) COMMENT 'Alpha numeric equivalent of sequence_number column', @@ -16,7 +16,7 @@ LAST_UPDATED_TIME DATETIME, LAST_UPDATED_BY VARCHAR(50)); -- COMMENT 'TABLE TO STORE GENERATED NAMES'; -CREATE TABLE SERVICE_PARAMETER (SERVICE_PARAMETER_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100), +CREATE TABLE SERVICE_PARAMETER (SERVICE_PARAMETER_ID INTEGER PRIMARY KEY AUTO_INCREMENT, NAME VARCHAR(500) NOT NULL COMMENT 'Parameter name', VALUE VARCHAR(500) COMMENT 'Parameter value', CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP, @@ -25,7 +25,7 @@ LAST_UPDATED_TIME DATETIME, LAST_UPDATED_BY VARCHAR(50) ); -CREATE TABLE IDENTIFIER_MAP (IDENTIFIER_MAP_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100), +CREATE TABLE IDENTIFIER_MAP (IDENTIFIER_MAP_ID INTEGER PRIMARY KEY AUTO_INCREMENT, POLICY_FN_NAME VARCHAR(500) COMMENT 'Function name in policy manager' NOT NULL, JS_FN_NAME VARCHAR(500) COMMENT 'Equivalent name in Java or script', CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP, @@ -35,7 +35,7 @@ LAST_UPDATED_BY VARCHAR(50) ); -CREATE TABLE EXTERNAL_INTERFACE (EXTERNAL_INTERFACE_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100), +CREATE TABLE EXTERNAL_INTERFACE (EXTERNAL_INTERFACE_ID INTEGER PRIMARY KEY AUTO_INCREMENT, SYSTEM VARCHAR(500) COMMENT 'Name of the external system', PARAM VARCHAR(500) COMMENT 'Parameters controlling the url', URL_SUFFIX VARCHAR(500) COMMENT 'The suffix of the URL for each value of the parameter', @@ -45,7 +45,7 @@ LAST_UPDATED_TIME DATETIME, LAST_UPDATED_BY VARCHAR(50) ); -CREATE TABLE POLICY_MAN_SIM (POLICY_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100), +CREATE TABLE POLICY_MAN_SIM (POLICY_ID INTEGER PRIMARY KEY AUTO_INCREMENT, POLICY_NAME VARCHAR(500) COMMENT 'Policy name' NOT NULL, POLICY_RESPONSE VARCHAR(10000) COMMENT 'Policy value', CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP -- cgit 1.2.3-korg