From a10606e383ce6c872cb7c95fe1d5e65565827813 Mon Sep 17 00:00:00 2001
From: "Smokowski, Steven" <steve.smokowski@att.com>
Date: Fri, 26 Apr 2019 21:10:25 -0400
Subject: Store Cloud Request in Database

Store Cloud Request in Database, add to request service
Add query Param to Plural to include cloud data

Change-Id: If906d28d0dc9c0c804e550e2074af3d75ba46d32
Issue-ID: SO-1807
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
---
 .../src/test/resources/schema.sql                       | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

(limited to 'mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql')

diff --git a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
index 2bd9936b3a..65372b7b48 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-requests-db-repositories/src/test/resources/schema.sql
@@ -1,5 +1,5 @@
 
-create table ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS (
+create table IF NOT EXISTS ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS (
         REQUEST_ID varchar(255) not null,
         OPERATIONAL_ENV_ID varchar(255) not null,
 		SERVICE_MODEL_VERSION_ID varchar(255) not null,
@@ -13,7 +13,7 @@ create table ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS (
         primary key (REQUEST_ID,OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID)
     );
     
-create table OPERATION_STATUS (
+create table IF NOT EXISTS OPERATION_STATUS (
         SERVICE_ID varchar(255) not null,
         OPERATION_ID varchar(255) not null,
         SERVICE_NAME varchar(255),
@@ -46,7 +46,7 @@ INSERT INTO PUBLIC.OPERATION_STATUS(SERVICE_ID, OPERATION_ID, OPERATION_TYPE, US
         primary key (SERVICE_ID,OPERATION_ID,RESOURCE_TEMPLATE_UUID)
     );
 
-CREATE CACHED TABLE PUBLIC.INFRA_ACTIVE_REQUESTS(
+CREATE TABLE IF NOT EXISTS PUBLIC.INFRA_ACTIVE_REQUESTS(
     REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100,
     CLIENT_REQUEST_ID VARCHAR SELECTIVITY 6,
     ACTION VARCHAR SELECTIVITY 1,
@@ -168,6 +168,17 @@ CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS(
     REQUEST_URL VARCHAR SELECTIVITY 1
 );
 
+CREATE TABLE IF NOT EXISTS cloud_api_requests(
+`ID` INT(13) NOT NULL AUTO_INCREMENT,
+`REQUEST_BODY` LONGTEXT NOT NULL,
+`CLOUD_IDENTIFIER` VARCHAR(200) NULL,
+`SO_REQUEST_ID` VARCHAR(45) NOT NULL,
+`CREATE_TIME` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`ID`),
+CONSTRAINT fk_cloud_api_req_infra_requests
+    FOREIGN KEY (SO_REQUEST_ID)
+    REFERENCES infra_active_requests (REQUEST_ID));
+
 CREATE CACHED TABLE PUBLIC.SITE_STATUS(
     SITE_NAME VARCHAR NOT NULL,
     STATUS VARCHAR,
-- 
cgit 1.2.3-korg

