From d7dc46d3a7924c5a380bb38d8794f05f11ab666e Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Wed, 28 Oct 2015 15:44:49 +0530 Subject: [PATCH] Refactored DB Scripts --- .../src/main/resources/dbscripts/cdm/h2.sql | 9 +++------ .../src/main/resources/dbscripts/cdm/mssql.sql | 17 +++++++---------- .../src/main/resources/dbscripts/cdm/mysql.sql | 3 +++ .../src/main/resources/dbscripts/cdm/oracle.sql | 17 +++++++---------- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql index 95a32302b1..42ee0a0df1 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -97,10 +97,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE ( DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); ---- POLICY RELATED TABLES ---- - - - +-- POLICY RELATED TABLES -- CREATE TABLE IF NOT EXISTS DM_PROFILE ( ID INT NOT NULL AUTO_INCREMENT , @@ -402,5 +399,5 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( -- NOTIFICATION TABLE END -- -- TO:DO - Remove this INSERT sql statement. ---Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (1, 'android'); ---Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (2, 'ios'); +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (1, 'android'); +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (2, 'ios'); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql index f8b05280f3..8bf49804b0 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -1,6 +1,3 @@ -/* SQLINES EVALUATION VERSION TRUNCATES VARIABLE NAMES AND COMMENTS. */ -/* OBTAIN A LICENSE AT WWW.SQLINES.COM FOR FULL CONVERSION. THANK YOU. */ - CREATE TABLE DM_DEVICE_TYPE ( ID INT identity NOT NULL, NAME VARCHAR(300) DEFAULT NULL, @@ -100,7 +97,7 @@ CREATE TABLE DM_DEVICE_OPERATION_RESPONSE ( DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); ---- POLICY RELA... *** SQLINES FOR EVALUATION USE ONLY *** +-- POLICY RELATED TABLES -- @@ -386,9 +383,9 @@ CREATE TABLE DM_DEVICE_APPLICATION_MAPPING ( DM_APPLICATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); --- POLICY RELAT... *** SQLINES FOR EVALUATION USE ONLY *** +-- POLICY RELATED TABLES FINISHED -- --- NOTIFICATION... *** SQLINES FOR EVALUATION USE ONLY *** +-- NOTIFICATION TABLE -- CREATE TABLE DM_NOTIFICATION ( NOTIFICATION_ID INTEGER IDENTITY NOT NULL, DEVICE_ID INTEGER NOT NULL, @@ -402,8 +399,8 @@ CREATE TABLE DM_NOTIFICATION ( CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); --- NOTIFICATION... *** SQLINES FOR EVALUATION USE ONLY *** +-- NOTIFICATION TABLE END -- --- TO:DO - Remo... *** SQLINES FOR EVALUATION USE ONLY *** ---Insert into D... *** SQLINES FOR EVALUATION USE ONLY *** ---Insert into D... *** SQLINES FOR EVALUATION USE ONLY *** \ No newline at end of file +-- TO:DO - Remove this INSERT sql statement. +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (1, 'android'); +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (2, 'ios'); \ No newline at end of file diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql index 10c1e83114..d7ca858e09 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -396,3 +396,6 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( )ENGINE = InnoDB; -- NOTIFICATION TABLE END -- +-- TO:DO - Remove this INSERT sql statement. +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (1, 'android'); +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (2, 'ios'); \ No newline at end of file diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql index be78bc1ded..2e8333d537 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -1,6 +1,3 @@ -/* SQLINES EVALUATION VERSION TRUNCATES VARIABLE NAMES AND COMMENTS. */ -/* OBTAIN A LICENSE AT WWW.SQLINES.COM FOR FULL CONVERSION. THANK YOU. */ - CREATE TABLE DM_DEVICE_TYPE ( ID NUMBER(10) NOT NULL, NAME VARCHAR2(300) DEFAULT NULL, @@ -166,7 +163,7 @@ BEGIN END; / ---- POLICY RELA... *** SQLINES FOR EVALUATION USE ONLY *** +-- POLICY RELATED TABLES --- @@ -601,9 +598,9 @@ BEGIN END; / --- POLICY RELAT... *** SQLINES FOR EVALUATION USE ONLY *** +-- POLICY RELATED TABLES FINISHED -- --- NOTIFICATION... *** SQLINES FOR EVALUATION USE ONLY *** +-- NOTIFICATION TABLE -- CREATE TABLE DM_NOTIFICATION ( NOTIFICATION_ID NUMBER(10) NOT NULL, DEVICE_ID NUMBER(10) NOT NULL, @@ -628,8 +625,8 @@ BEGIN SELECT DM_NOTIFICATION_seq.NEXTVAL INTO :NEW.NOTIFICATION_ID FROM DUAL; END; / --- NOTIFICATION... *** SQLINES FOR EVALUATION USE ONLY *** +-- NOTIFICATION TABLE END -- --- TO:DO - Remo... *** SQLINES FOR EVALUATION USE ONLY *** ---Insert into D... *** SQLINES FOR EVALUATION USE ONLY *** ---Insert into D... *** SQLINES FOR EVALUATION USE ONLY *** \ No newline at end of file +-- TO:DO - Remove this INSERT sql statement. +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (1, 'android'); +Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (2, 'ios'); \ No newline at end of file