diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index c9d4f4d..e084cfe 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -39,6 +39,9 @@
 import java.nio.file.Paths;
 import java.util.List;
 import java.util.Optional;
+import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
+import org.onap.so.asdc.util.ZipParser;
 import org.onap.so.logger.LoggingAnchor;
 import org.onap.logging.ref.slf4j.ONAPLogConstants;
 import org.onap.sdc.api.IDistributionClient;
@@ -737,6 +740,7 @@
 
     protected void processResourceNotification(INotificationData iNotif) {
         // For each artifact, create a structure describing the VFModule in a ordered flat level
+        ResourceStructure resourceStructure = null;
         String msoConfigPath = getMsoConfigPath();
         ToscaResourceStructure toscaResourceStructure = new ToscaResourceStructure(msoConfigPath);
         DistributionStatusEnum deployStatus = DistributionStatusEnum.DEPLOY_OK;
@@ -748,8 +752,8 @@
             if (isCsarAlreadyDeployed(iNotif, toscaResourceStructure)) {
                 return;
             }
-
-            ResourceStructure resourceStructure = null;
+            // process NsstResource
+            this.processNsstNotification(iNotif, toscaResourceStructure);
             for (IResourceInstance resource : iNotif.getResources()) {
 
                 String resourceType = resource.getResourceType();
@@ -914,6 +918,23 @@
                             "processCsarServiceArtifacts", ErrorCode.BusinessProcessError.getValue(),
                             "Exception in processCsarServiceArtifacts", e);
                 }
+            } else if (artifact.getArtifactType().equals(ASDCConfiguration.OTHER)) {
+                try {
+                    IDistributionClientDownloadResult resultArtifact =
+                            this.downloadTheArtifact(artifact, iNotif.getDistributionID());
+
+                    writeArtifactToFile(artifact, resultArtifact);
+
+                    toscaResourceStructure.setToscaArtifact(artifact);
+
+                    toscaResourceStructure.setServiceVersion(iNotif.getServiceVersion());
+
+                } catch (ASDCDownloadException e) {
+                    logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(),
+                            "Exception caught during processCsarServiceArtifacts", "ASDC",
+                            "processCsarServiceArtifacts", ErrorCode.BusinessProcessError.getValue(),
+                            "Exception in processCsarServiceArtifacts", e);
+                }
             }
 
 
@@ -940,4 +961,38 @@
         }
         return UNKNOWN;
     }
+
+    private void processNsstNotification(INotificationData iNotif, ToscaResourceStructure toscaResourceStructure) {
+        Metadata serviceMetadata = toscaResourceStructure.getServiceMetadata();
+        try {
+            if (serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY).equalsIgnoreCase("NSST")) {
+
+                String artifactContent = null;
+                List<IArtifactInfo> serviceArtifacts = iNotif.getServiceArtifacts();
+                Optional<IArtifactInfo> artifactOpt = serviceArtifacts.stream()
+                        .filter(e -> e.getArtifactType().equalsIgnoreCase("OTHER")).findFirst();
+                if (artifactOpt.isPresent()) {
+                    IArtifactInfo artifactInfo = artifactOpt.get();
+                    logger.debug("Ready to parse this serviceArtifactUUID:  " + artifactInfo.getArtifactUUID());
+                    String filePath = Paths.get(getMsoConfigPath(), "ASDC", artifactInfo.getArtifactVersion(),
+                            artifactInfo.getArtifactName()).normalize().toString();
+                    ZipParser zipParserInstance = ZipParser.getInstance();
+                    artifactContent = zipParserInstance.parseJsonForZip(filePath);
+                    logger.debug(
+                            "serviceArtifact parsing success! serviceArtifactUUID: " + artifactInfo.getArtifactUUID());
+                } else {
+                    logger.debug("serviceArtifact is null");
+                }
+                ResourceStructure resourceStructure = new VfResourceStructure(iNotif, new ResourceInstance());
+                resourceStructure.setResourceType(ResourceType.OTHER);
+                toscaInstaller.installTheNsstService(toscaResourceStructure, (VfResourceStructure) resourceStructure,
+                        artifactContent);
+            }
+        } catch (IOException e) {
+            logger.error("serviceArtifact parse failure for service uuid:  "
+                    + serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
+        } catch (Exception e) {
+            logger.error("error NSST process resource failure ", e);
+        }
+    }
 }
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 263118d..3175839 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -54,6 +54,7 @@
 import org.onap.sdc.tosca.parser.enums.SdcTypes;
 import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
 import org.onap.sdc.toscaparser.api.CapabilityAssignment;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
 import org.onap.sdc.toscaparser.api.Property;
 import org.onap.sdc.toscaparser.api.RequirementAssignment;
 import org.onap.sdc.toscaparser.api.elements.Metadata;
@@ -74,64 +75,8 @@
 import org.onap.so.asdc.installer.VfResourceStructure;
 import org.onap.so.asdc.installer.bpmn.WorkflowResource;
 import org.onap.so.asdc.util.YamlEditor;
-import org.onap.so.db.catalog.beans.AllottedResource;
-import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
-import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.CollectionResource;
-import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization;
-import org.onap.so.db.catalog.beans.ConfigurationResource;
-import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
-import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
-import org.onap.so.db.catalog.beans.CvnfcCustomization;
-import org.onap.so.db.catalog.beans.HeatEnvironment;
-import org.onap.so.db.catalog.beans.HeatFiles;
-import org.onap.so.db.catalog.beans.HeatTemplate;
-import org.onap.so.db.catalog.beans.HeatTemplateParam;
-import org.onap.so.db.catalog.beans.InstanceGroup;
-import org.onap.so.db.catalog.beans.InstanceGroupType;
-import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
-import org.onap.so.db.catalog.beans.NetworkInstanceGroup;
-import org.onap.so.db.catalog.beans.NetworkResource;
-import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.PnfResource;
-import org.onap.so.db.catalog.beans.PnfResourceCustomization;
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
-import org.onap.so.db.catalog.beans.SubType;
-import org.onap.so.db.catalog.beans.TempNetworkHeatTemplateLookup;
-import org.onap.so.db.catalog.beans.ToscaCsar;
-import org.onap.so.db.catalog.beans.VFCInstanceGroup;
-import org.onap.so.db.catalog.beans.VfModule;
-import org.onap.so.db.catalog.beans.VfModuleCustomization;
-import org.onap.so.db.catalog.beans.VnfResource;
-import org.onap.so.db.catalog.beans.VnfResourceCustomization;
-import org.onap.so.db.catalog.beans.VnfcCustomization;
-import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
-import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
-import org.onap.so.db.catalog.data.repository.CollectionResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.CollectionResourceRepository;
-import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.ConfigurationResourceRepository;
-import org.onap.so.db.catalog.data.repository.CvnfcCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.ExternalServiceToInternalServiceRepository;
-import org.onap.so.db.catalog.data.repository.HeatEnvironmentRepository;
-import org.onap.so.db.catalog.data.repository.HeatFilesRepository;
-import org.onap.so.db.catalog.data.repository.HeatTemplateRepository;
-import org.onap.so.db.catalog.data.repository.InstanceGroupRepository;
-import org.onap.so.db.catalog.data.repository.NetworkResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
-import org.onap.so.db.catalog.data.repository.PnfCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.PnfResourceRepository;
-import org.onap.so.db.catalog.data.repository.ServiceProxyResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.ServiceRepository;
-import org.onap.so.db.catalog.data.repository.TempNetworkHeatTemplateRepository;
-import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
-import org.onap.so.db.catalog.data.repository.VFModuleCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.VFModuleRepository;
-import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
-import org.onap.so.db.catalog.data.repository.VnfcCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository;
+import org.onap.so.db.catalog.beans.*;
+import org.onap.so.db.catalog.data.repository.*;
 import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
 import org.onap.so.db.request.beans.WatchdogDistributionStatus;
 import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup;
@@ -271,6 +216,9 @@
     protected PnfCustomizationRepository pnfCustomizationRepository;
 
     @Autowired
+    protected ServiceInfoRepository serviceInfoRepository;
+
+    @Autowired
     protected WorkflowResource workflowResource;
 
     @Autowired
@@ -445,6 +393,7 @@
             createToscaCsar(toscaResourceStruct);
             createService(toscaResourceStruct, vfResourceStruct);
             Service service = toscaResourceStruct.getCatalogService();
+            ServiceInfo serviceInfo = createServiceInfo(toscaResourceStruct, service);
 
             List<IEntityDetails> vfEntityList = getEntityDetails(toscaResourceStruct,
                     EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
@@ -474,8 +423,9 @@
             processServiceProxyAndConfiguration(toscaResourceStruct, service);
 
             logger.info("Saving Service: {} ", service.getModelName());
-            service = serviceRepo.save(service);
-            correlateConfigCustomResources(service);
+            ServiceInfo serviceResult = serviceInfoRepository.save(serviceInfo);
+            Service resultService = serviceResult.getService();
+            correlateConfigCustomResources(resultService);
 
             workflowResource.processWorkflows(vfResourceStructure);
 
@@ -2912,5 +2862,122 @@
         return new Timestamp(new Date().getTime());
     }
 
+    private String getServiceInput(ToscaResourceStructure toscaResourceStructure) {
+        String serviceInput = null;
+
+        List<Object> serviceInputList;
+        ISdcCsarHelper sdcCsarHelper = toscaResourceStructure.getSdcCsarHelper();
+        List<Input> serviceInputs = sdcCsarHelper.getServiceInputs();
+        if (!serviceInputs.isEmpty()) {
+            serviceInputList = new ArrayList<>();
+            serviceInputs.forEach(input -> {
+                Map<String, Object> serviceInputMap = new HashMap<>();
+                serviceInputMap.put("name", input.getName());
+                serviceInputMap.put("type", input.getType());
+                serviceInputMap.put("default", input.getDefault() == null ? "" : input.getDefault());
+                serviceInputMap.put("required", input.isRequired());
+                serviceInputList.add(serviceInputMap);
+
+            });
+            ObjectMapper objectMapper = new ObjectMapper();
+            try {
+                serviceInput = objectMapper.writeValueAsString(serviceInputList);
+                serviceInput = serviceInput.replace("\"", "\\\"");
+            } catch (JsonProcessingException e) {
+                logger.error("service input could not be deserialized for service uuid:  "
+                        + sdcCsarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+            }
+        } else {
+            logger.debug("serviceInput is null");
+        }
+        return serviceInput;
+    }
+
+    @Transactional(rollbackFor = {ArtifactInstallerException.class})
+    public void installTheNsstService(ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStruct,
+            String artifactContent) {
+        createToscaCsar(toscaResourceStruct);
+        createService(toscaResourceStruct, vfResourceStruct);
+        Service service = toscaResourceStruct.getCatalogService();
+        ServiceInfo serviceInfo = createServiceInfo(toscaResourceStruct, service);
+        createServiceArtifact(service, vfResourceStruct, artifactContent);
+        serviceInfoRepository.save(serviceInfo);
+    }
+
+    private void createServiceArtifact(Service service, VfResourceStructure vfResourceStruct, String artifactContent) {
+        List<ServiceArtifact> serviceArtifactList = new ArrayList<>();
+        ServiceArtifact serviceArtifact;
+        List<IArtifactInfo> artifactInfoList = vfResourceStruct.getNotification().getServiceArtifacts().stream()
+                .filter(artifact -> artifact.getArtifactType().equalsIgnoreCase("OTHER")).collect(Collectors.toList());
+        for (IArtifactInfo artifactInfo : artifactInfoList) {
+            serviceArtifact = new ServiceArtifact();
+            serviceArtifact.setArtifactUUID(artifactInfo.getArtifactUUID());
+            serviceArtifact.setName(artifactInfo.getArtifactName());
+            serviceArtifact.setType(artifactInfo.getArtifactType());
+            serviceArtifact.setVersion(artifactInfo.getArtifactVersion());
+            serviceArtifact.setDescription(artifactInfo.getArtifactDescription());
+            serviceArtifact.setChecksum(artifactInfo.getArtifactChecksum());
+            serviceArtifact.setContent(artifactContent);
+            serviceArtifact.setService(service);
+            serviceArtifactList.add(serviceArtifact);
+        }
+        service.setServiceArtifactList(serviceArtifactList);
+    }
+
+    private ServiceInfo createServiceInfo(ToscaResourceStructure toscaResourceStruct, Service service) {
+        ServiceInfo serviceInfo = new ServiceInfo();
+        String serviceInput = getServiceInput(toscaResourceStruct);
+        serviceInfo.setServiceInput(serviceInput);
+
+        String serviceProperties = getServiceProperties(toscaResourceStruct);
+        serviceInfo.setServiceProperties(serviceProperties);
+
+        serviceInfo.setService(service);
+        return serviceInfo;
+    }
+
+    private String getServiceProperties(ToscaResourceStructure toscaResourceStruct) {
+        String propertiesJson = null;
+        ObjectMapper objectMapper = new ObjectMapper();
+        ISdcCsarHelper helper = toscaResourceStruct.getSdcCsarHelper();
+        String typeName = helper.getServiceSubstitutionMappingsTypeName();
+        Optional<NodeTemplate> nodeTemplate = helper.getServiceNodeTemplates().stream().findAny();
+        List<Object> serviceProperties = new ArrayList<>();
+        Map<String, Object> servicePropertiesMap;
+        if (nodeTemplate.isPresent()) {
+            LinkedHashMap<String, Object> customDef = nodeTemplate.get().getCustomDef();
+            Optional<String> machKey =
+                    customDef.keySet().stream().filter(key -> key.equalsIgnoreCase(typeName)).findFirst();
+            if (machKey.isPresent()) {
+                Object obj = customDef.get(machKey.get());
+                try {
+                    if (obj instanceof Map) {
+                        Object properties = ((HashMap) obj).get("properties");
+                        if (null != properties) {
+                            for (Object propertyName : ((Map) properties).keySet()) {
+                                servicePropertiesMap = new HashMap<>();
+                                servicePropertiesMap.put("name", propertyName);
+                                Object object = ((Map) properties).get(propertyName);
+                                for (Object entry : ((Map) object).entrySet()) {
+                                    servicePropertiesMap.put((String) ((Map.Entry) entry).getKey(),
+                                            ((Map.Entry) entry).getValue());
+                                }
+                                servicePropertiesMap.remove("description");
+                                serviceProperties.add(servicePropertiesMap);
+                            }
+                            propertiesJson = objectMapper.writeValueAsString(serviceProperties);
+                            propertiesJson = propertiesJson.replace("\"", "\\\"");
+                        }
+                    }
+                } catch (JsonProcessingException e) {
+                    logger.error("serviceProperties could not be deserialized for service uuid:  "
+                            + nodeTemplate.get().getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+                }
+            }
+        } else {
+            logger.debug("ServiceNodeTemplates is null");
+        }
+        return propertiesJson;
+    }
 }
 
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
index c25c4c2..b8a2d01 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
@@ -75,19 +75,8 @@
 import org.onap.so.asdc.installer.VfModuleStructure;
 import org.onap.so.asdc.installer.VfResourceStructure;
 import org.onap.so.asdc.installer.bpmn.WorkflowResource;
-import org.onap.so.db.catalog.beans.ConfigurationResource;
-import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization;
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization;
-import org.onap.so.db.catalog.beans.ToscaCsar;
-import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
-import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository;
-import org.onap.so.db.catalog.data.repository.InstanceGroupRepository;
-import org.onap.so.db.catalog.data.repository.ServiceRepository;
-import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
-import org.onap.so.db.catalog.data.repository.VFModuleRepository;
-import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
-import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository;
+import org.onap.so.db.catalog.beans.*;
+import org.onap.so.db.catalog.data.repository.*;
 import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
 import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -325,8 +314,6 @@
         notificationData.setServiceUUID("serviceUUID1");
         notificationData.setWorkloadContext("workloadContext1");
 
-
-
         String serviceType = "test-type1";
         String serviceRole = "test-role1";
         String category = "Network L3+";
@@ -356,6 +343,7 @@
         doReturn(resourceCustomizationUUID).when(metadata).getValue("vfModuleModelCustomizationUUID");
 
         ServiceRepository serviceRepo = spy(ServiceRepository.class);
+        ServiceInfoRepository serviceInfoRepo = spy(ServiceInfoRepository.class);
 
         VnfResourceRepository vnfRepo = spy(VnfResourceRepository.class);
         doReturn(null).when(vnfRepo).findResourceByModelUUID(uuid);
@@ -366,6 +354,7 @@
         WorkflowResource workflowResource = spy(WorkflowResource.class);
 
         ReflectionTestUtils.setField(toscaInstaller, "serviceRepo", serviceRepo);
+        ReflectionTestUtils.setField(toscaInstaller, "serviceInfoRepository", serviceInfoRepo);
         ReflectionTestUtils.setField(toscaInstaller, "vnfRepo", vnfRepo);
         ReflectionTestUtils.setField(toscaInstaller, "vfModuleRepo", vfModuleRepo);
         ReflectionTestUtils.setField(toscaInstaller, "instanceGroupRepo", instanceGroupRepo);
@@ -436,7 +425,10 @@
         assertNotNull(service);
         service.setModelVersion("1.0");
 
+        ServiceInfo serviceInfo = new ServiceInfo();
+        serviceInfo.setService(service);
         doReturn(service).when(serviceRepo).save(service);
+        doReturn(serviceInfo).when(serviceInfoRepo).save(any(ServiceInfo.class));
 
         WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository =
                 spy(WatchdogComponentDistributionStatusRepository.class);
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java b/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java
index 53d163a..02c0f2d 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/utils/ASDCLoggingVisitorImpl.java
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index 0821ebc..d051d1a 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -1378,6 +1378,34 @@
 ENGINE = InnoDB
 DEFAULT CHARACTER SET = latin1;
 
+CREATE TABLE IF NOT EXISTS `service_info` (
+  `ID` int (11) AUTO_INCREMENT,
+  `SERVICE_INPUT` varchar (5000),
+  `SERVICE_PROPERTIES` varchar (5000),
+  PRIMARY KEY (`ID`)
+)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `service_artifact`(
+  `ARTIFACT_UUID` varchar (200) NOT NULL,
+  `TYPE` varchar (200) NOT NULL,
+  `NAME` varchar (200) NOT NULL,
+  `VERSION` varchar (200) NOT NULL,
+  `DESCRIPTION` varchar (200) DEFAULT NULL,
+  `CONTENT` LONGTEXT DEFAULT NULL,
+  `CHECKSUM` varchar (200) DEFAULT NULL,
+  `CREATION_TIMESTAMP` DATETIME DEFAULT CURRENT_TIMESTAMP,
+  `SERVICE_MODEL_UUID` varchar (200) NOT NULL,
+  PRIMARY KEY (`ARTIFACT_UUID`),
+  CONSTRAINT `fk_service_artifact_service_info1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
+)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `service_to_service_info` (
+  `SERVICE_MODEL_UUID` varchar (200) NOT NULL,
+  `SERVICE_INFO_ID` INT (11) NOT NULL,
+  PRIMARY KEY (`SERVICE_MODEL_UUID`,`SERVICE_INFO_ID`),
+  CONSTRAINT `fk_service_to_service_info__service1` FOREIGN KEY (`SERVICE_MODEL_UUID`) REFERENCES `service` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `fk_service_to_service_info__service_info1` FOREIGN KEY (`SERVICE_INFO_ID`) REFERENCES `service_info` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
+)ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 --------START Request DB SCHEMA --------
 CREATE DATABASE requestdb;
