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>
diff --git a/extra/sql/bulkload/clds-stored-procedures.sql b/extra/sql/bulkload/clds-stored-procedures.sql
index 112cb2b..d09d3fc 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_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 @@
   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 ;