From 11ca44c2132eb2ce12d3e36789b04896bf518149 Mon Sep 17 00:00:00 2001
From: tangpeng <tang.peng5@zte.com.cn>
Date: Mon, 27 Feb 2017 14:23:22 +0800
Subject: Add holmes sql script

Change-Id: I707d410fe4f1389f8002a4526f53d15484125377
Issue-Id:HOLMES-47
Signed-off-by: tangpeng <tang.peng5@zte.com.cn>
---
 .../mysql/openo-holmes_engine_d-createobj.sql      | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)

(limited to 'engine-d-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_engine_d-createobj.sql')

diff --git a/engine-d-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_engine_d-createobj.sql b/engine-d-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_engine_d-createobj.sql
index 4f5294a..73d51ee 100644
--- a/engine-d-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_engine_d-createobj.sql
+++ b/engine-d-standalone/src/main/assembly/dbscripts/mysql/openo-holmes_engine_d-createobj.sql
@@ -13,5 +13,48 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 --
+/******************drop old database and user***************************/
+use mysql;
+drop database IF  EXISTS holmes;
+delete from user where User='holmes';
+FLUSH PRIVILEGES;
 
+/******************create new database and user***************************/
+create database holmes CHARACTER SET utf8;
+
+GRANT ALL PRIVILEGES ON holmes.* TO 'holmes'@'%' IDENTIFIED BY 'holmes' WITH GRANT OPTION;
+GRANT ALL PRIVILEGES ON mysql.* TO 'holmes'@'%' IDENTIFIED BY 'holmes' WITH GRANT OPTION;
+
+GRANT ALL PRIVILEGES ON catalog.* TO 'holmes'@'localhost' IDENTIFIED BY 'holmes' WITH GRANT OPTION;
+GRANT ALL PRIVILEGES ON mysql.* TO 'holmes'@'localhost' IDENTIFIED BY 'holmes' WITH GRANT OPTION;
+FLUSH PRIVILEGES;
+
+use holmes;
+set Names 'utf8';
+/******************delete old table and create new***************************/
+use holmes;
+DROP TABLE IF EXISTS aplus_rule;
+CREATE TABLE aplus_rule (
+  rid varchar(30) NOT NULL,
+  name varchar(150) CHARACTER NOT NULL,
+  description varchar(4000) CHARACTER SET  DEFAULT NULL,
+  enable int(1) NOT NULL,
+  templateID int(10) NOT NULL,
+  engineID varchar(20) CHARACTER  NOT NULL,
+  engineType varchar(20) CHARACTER  NOT NULL,
+  creator varchar(20) CHARACTER  NOT NULL,
+  createTime datetime NOT NULL,
+  updator varchar(20) CHARACTER  DEFAULT NULL,
+  updateTime datetime DEFAULT NULL,
+  params varchar(4000) CHARACTER  DEFAULT NULL,
+  content varchar(4000) CHARACTER  NOT NULL,
+  vendor varchar(100) CHARACTER  NOT NULL,
+  package varchar(255) DEFAULT NULL,
+  PRIMARY KEY (rid),
+  UNIQUE KEY name (name),
+  KEY IDX_APLUS_RULE_ENABLE (enable),
+  KEY IDX_APLUS_RULE_TEMPLATEID (templateID),
+  KEY IDX_APLUS_RULE_ENGINEID (engineID),
+  KEY IDX_APLUS_RULE_ENGINETYPE (engineType)
+)
 
-- 
cgit 1.2.3-korg

