diff options
author | Steve Smokowski <ss835w@att.com> | 2021-02-17 14:35:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-02-17 14:35:54 +0000 |
commit | ba4f60d79b9039c9cb1db46e68c4e9b3efe8f708 (patch) | |
tree | b7e1aa340c13abddd6019c350dda8f59efabff0b /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service | |
parent | 207a5e38c1f565c4f07f54b7ff174c0002fdb413 (diff) | |
parent | d5968f56b382c50dfafc3b6feeccf5b81d176b9d (diff) |
Merge "update camunda and spring to latest versions"
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service')
3 files changed, 15 insertions, 14 deletions
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql index 85a732b83e..7f50c791f6 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/resources/db/migration/V1_1__create_nfvo_tables.sql @@ -1,7 +1,7 @@ use nfvo; CREATE TABLE IF NOT EXISTS `JOB` ( - `JOB_ID` varchar(255) NOT NULL, + `JOB_ID` varchar(255) PRIMARY KEY NOT NULL, `JOB_TYPE` varchar(255) NOT NULL, `JOB_ACTION` varchar(255) NOT NULL, `RESOURCE_ID` varchar(255) NOT NULL, @@ -10,26 +10,24 @@ CREATE TABLE IF NOT EXISTS `JOB` ( `START_TIME` DATETIME DEFAULT NULL, `END_TIME` DATETIME DEFAULT NULL, `PROGRESS` int(11) DEFAULT NULL, - `PROCESS_INSTANCE_ID` varchar(255) DEFAULT NULL, - PRIMARY KEY (`JOB_ID`) + `PROCESS_INSTANCE_ID` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `JOB_STATUS` ( - `ID` INT NOT NULL AUTO_INCREMENT, + `ID` INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `UPDATED_TIME` DATETIME NOT NULL, `DESCRIPTION` longtext DEFAULT NULL, `STATUS` varchar(255) NOT NULL, `JOB_ID` varchar(255) NOT NULL, - PRIMARY KEY (`ID`), FOREIGN KEY (JOB_ID) REFERENCES JOB(JOB_ID) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `NS_INST` ( - `NS_INST_ID` varchar(255) NOT NULL, + `NS_INST_ID` varchar(255) PRIMARY KEY NOT NULL, `NAME` varchar(255) NOT NULL, `NS_PACKAGE_ID` varchar(255) DEFAULT NULL, `NSD_ID` varchar(255) NOT NULL, @@ -38,12 +36,11 @@ CREATE TABLE IF NOT EXISTS `NS_INST` ( `STATUS` varchar(255) NOT NULL, `STATUS_UPDATED_TIME` DATETIME NOT NULL, `GLOBAL_CUSTOMER_ID` varchar(255) DEFAULT NULL, - `SERVICE_TYPE` varchar(255) DEFAULT NULL, - PRIMARY KEY (`NS_INST_ID`) + `SERVICE_TYPE` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `NF_INST` ( - `NF_INST_ID` varchar(255) NOT NULL, + `NF_INST_ID` varchar(255) PRIMARY KEY NOT NULL, `NAME` varchar(255) DEFAULT NULL, `VNFD_ID` varchar(255) DEFAULT NULL, `PACKAGE_ID` varchar(255) DEFAULT NULL, @@ -51,14 +48,13 @@ CREATE TABLE IF NOT EXISTS `NF_INST` ( `STATUS` varchar(255) NOT NULL, `CREATE_TIME` DATETIME DEFAULT NULL, `LAST_UPDATE_TIME` DATETIME DEFAULT NULL, - PRIMARY KEY (`NF_INST_ID`), FOREIGN KEY (NS_INST_ID) REFERENCES NS_INST(NS_INST_ID) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `NS_LCM_OP_OCCS` ( - `ID` varchar(255) NOT NULL, + `ID` varchar(255) PRIMARY KEY NOT NULL, `OPERATION_STATE` varchar(255) NOT NULL, `STATE_ENTERED_TIME` DATETIME DEFAULT NULL, `START_TIME` DATETIME DEFAULT NULL, @@ -68,7 +64,6 @@ CREATE TABLE IF NOT EXISTS `NS_LCM_OP_OCCS` ( `OPERATION_PARAMS` longtext NOT NULL, `IS_CANCEL_PENDING` varchar(255) NOT NULL, `CANCEL_MODE` varchar(255) DEFAULT NULL, - PRIMARY KEY (`ID`), FOREIGN KEY (NS_INST_ID) REFERENCES NS_INST(NS_INST_ID) ON UPDATE CASCADE ON DELETE CASCADE diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java index fcf7f9c373..b9858a8dd5 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/java/org/onap/so/etsi/nfvo/ns/lcm/database/DatabaseServiceProviderTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; import java.util.Optional; import java.util.UUID; @@ -55,7 +56,7 @@ public class DatabaseServiceProviderTest { private static final String RANDOM_ID = UUID.randomUUID().toString(); private static final String DUMMY_NAME = "NAME"; - private static final LocalDateTime CURRENT_DATE_TIME = LocalDateTime.now(); + private static final LocalDateTime CURRENT_DATE_TIME = LocalDateTime.now().truncatedTo(ChronoUnit.MILLIS); @Autowired private DatabaseServiceProvider databaseServiceProvider; diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml index adc36aca1d..478a5b5ac7 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/test/resources/application.yaml @@ -17,14 +17,19 @@ spring: datasource: hikari: nfvo: - jdbcUrl: jdbc:h2:mem:nfvo;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS nfvo; + jdbcUrl: jdbc:h2:mem:nfvo;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS nfvo;MODE=MYSQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE driver-class-name: org.h2.Driver pool-name: ns-lcm-bpmn-pool registerMbeans: true + test: + database: + replace: NONE jpa: generate-ddl: true + dialect: org.hibernate.dialect.MySQL5Dialect hibernate: ddl-auto: create + database-platform: org.hibernate.dialect.MariaDBDialect hibernate: dialect: org.hibernate.dialect.H2Dialect hbm2ddl: |