summaryrefslogtreecommitdiffstats
path: root/installation
diff options
context:
space:
mode:
authorDavid Stilwell <stilwelld@att.com>2018-05-30 19:15:57 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-30 19:15:57 +0000
commit0c40382d036621428b9c6c15a82ecf3d45c6d347 (patch)
tree4dfeb4bae73e19fa5a215a4d2cce027f16e8f911 /installation
parent9c037e68b5f1fd3acbac7fd77c428b71932b896b (diff)
parentc12079ad6151ef2cc59e482fc65af5dcb9bb8b37 (diff)
Merge "Fix ref to SERVICE_MODEL"
Former-commit-id: 57f7417b93bbbf8ed00b667c97f5417ea181f4e3
Diffstat (limited to 'installation')
-rw-r--r--installation/sdnc/src/main/resources/network_model.data.dump2
-rw-r--r--installation/sdnc/src/main/scripts/installSdncDb.sh3
-rw-r--r--installation/sdnc/src/main/scripts/rmForeignKey.sh18
3 files changed, 22 insertions, 1 deletions
diff --git a/installation/sdnc/src/main/resources/network_model.data.dump b/installation/sdnc/src/main/resources/network_model.data.dump
index 9d9cb1f6..f0c256fb 100644
--- a/installation/sdnc/src/main/resources/network_model.data.dump
+++ b/installation/sdnc/src/main/resources/network_model.data.dump
@@ -53,7 +53,7 @@ CREATE TABLE `NETWORK_MODEL` (
`version` varchar(255) DEFAULT NULL,
PRIMARY KEY (`customization_uuid`),
KEY `FK_NETWORK_MODEL` (`service_uuid`),
- CONSTRAINT `FK_NETWORK_MODEL` FOREIGN KEY (`service_uuid`) REFERENCES `service_model` (`service_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION
+ CONSTRAINT `FK_NETWORK_MODEL` FOREIGN KEY (`service_uuid`) REFERENCES `SERVICE_MODEL` (`service_uuid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/installation/sdnc/src/main/scripts/installSdncDb.sh b/installation/sdnc/src/main/scripts/installSdncDb.sh
index 7f05d723..e726f5f8 100644
--- a/installation/sdnc/src/main/scripts/installSdncDb.sh
+++ b/installation/sdnc/src/main/scripts/installSdncDb.sh
@@ -52,3 +52,6 @@ done
# Create VNIs 100-199
${SDNC_HOME}/bin/addVnis.sh 100 199
+
+# Drop FK_NETWORK_MODEL foreign key as workaround for SDNC-291.
+${SDNC_HOME}/bin/rmForeignKey.sh NETWORK_MODEL FK_NETWORK_MODEL
diff --git a/installation/sdnc/src/main/scripts/rmForeignKey.sh b/installation/sdnc/src/main/scripts/rmForeignKey.sh
new file mode 100644
index 00000000..40914fa2
--- /dev/null
+++ b/installation/sdnc/src/main/scripts/rmForeignKey.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+MYSQL_USER=${MYSQL_USER:-sdnctl}
+MYSQL_PWD=${MYSQL_PWD:-gamma}
+MYSQL_DB=${MYSQL_DB:-sdnctl}
+MYSQL_HOST=${MYSQL_HOST:-dbhost}
+
+
+if [ $# -ne 2 ]
+then
+ echo "Usage: $0 table foreign-key"
+ exit 1
+fi
+
+mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host ${MYSQL_HOST} ${MYSQL_DB} <<EOF
+ALTER TABLE $1
+DROP FOREIGN KEY $2;
+EOF