From 7a58af870eb9934dfec4b5353672d7c428208116 Mon Sep 17 00:00:00 2001
From: "Determe, Sebastien (sd378r)" <sd378r@intl.att.com>
Date: Wed, 6 Jun 2018 13:47:21 +0200
Subject: Minor Improvement

Code rework postponed to Casablanca to not impact Bejing release +
Update version to 3.0.0

Issue-ID: CLAMP-177

Change-Id: I3e2cb22c1158df0cf5d4cf8369f9c469004d68c0
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
---
 extra/sql/bulkload/clds-stored-procedures.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'extra/sql/bulkload/clds-stored-procedures.sql')

diff --git a/extra/sql/bulkload/clds-stored-procedures.sql b/extra/sql/bulkload/clds-stored-procedures.sql
index 112cb2b55..d09d3fc81 100644
--- a/extra/sql/bulkload/clds-stored-procedures.sql
+++ b/extra/sql/bulkload/clds-stored-procedures.sql
@@ -14,6 +14,7 @@ DROP PROCEDURE IF EXISTS get_model;
 DROP PROCEDURE IF EXISTS get_model_template;
 DROP PROCEDURE IF EXISTS set_template;
 DROP PROCEDURE IF EXISTS get_template;
+DROP PROCEDURE IF EXISTS del_model;
 DELIMITER //
 CREATE PROCEDURE get_template
   (IN v_template_name VARCHAR(80),
@@ -444,6 +445,16 @@ BEGIN
   UPDATE event
 	SET process_instance_id = v_process_instance_id
 	WHERE event_id = v_event_id;
+END;
+CREATE PROCEDURE del_model (IN v_model_name VARCHAR(80))
+BEGIN
+    DECLARE v_model_id VARCHAR(36);
+    SELECT model_id INTO v_model_id from model where model_name = v_model_name;
+    UPDATE model set event_id = null, model_blueprint_id = null, model_prop_id = null where model_id = v_model_id;
+	DELETE from event where model_id = v_model_id;
+	DELETE from model_blueprint where model_id = v_model_id;
+	DELETE from model_properties where model_id = v_model_id;
+    DELETE from model where model_id = v_model_id;
 END
 //
 DELIMITER ;
-- 
cgit 1.2.3-korg

