diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
index 4e6a4b0ada7..3e6168d7033 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml
@@ -86,21 +86,6 @@
-
-
- org.testng
- testng
- test
-
-
- junit
- junit
- test
-
-
-
-
-
diff --git a/product/modules/distribution/src/repository/dbscripts/cdm/h2.sql b/product/modules/distribution/src/repository/dbscripts/cdm/h2.sql
new file mode 100644
index 00000000000..4c1e805f9b2
--- /dev/null
+++ b/product/modules/distribution/src/repository/dbscripts/cdm/h2.sql
@@ -0,0 +1,23 @@
+CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE
+(
+ ID INT(11) NOT NULL,
+ NAME VARCHAR(300) NULL DEFAULT NULL,
+ PRIMARY KEY (ID)
+);
+
+CREATE TABLE IF NOT EXISTS DM_DEVICE
+(
+ ID VARCHAR(20) NOT NULL,
+ DESCRIPTION TEXT NULL DEFAULT NULL,
+ NAME VARCHAR(100) NULL DEFAULT NULL,
+ DATE_OF_ENROLLMENT DATETIME NULL DEFAULT NULL,
+ DATE_OF_LAST_UPDATE DATETIME NULL DEFAULT NULL,
+ OWNERSHIP VARCHAR(45) NULL DEFAULT NULL,
+ STATUS VARCHAR(15) NULL DEFAULT NULL,
+ DEVICE_TYPE_ID INT(11) NULL DEFAULT NULL,
+ DEVICE_IDENTIFICATION VARCHAR(300) NULL DEFAULT NULL,
+ OWNER VARCHAR(45) NULL DEFAULT NULL,
+ PRIMARY KEY (ID),
+ CONSTRAINT fk_DM_DEVICE_DM_DEVICE_TYPE2 FOREIGN KEY (DEVICE_TYPE_ID )
+ REFERENCES DM_DEVICE_TYPE (ID ) ON DELETE NO ACTION ON UPDATE NO ACTION
+);
diff --git a/product/modules/distribution/src/repository/dbscripts/cdm/h2.sql~ b/product/modules/distribution/src/repository/dbscripts/cdm/h2.sql~
new file mode 100644
index 00000000000..4c1e805f9b2
--- /dev/null
+++ b/product/modules/distribution/src/repository/dbscripts/cdm/h2.sql~
@@ -0,0 +1,23 @@
+CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE
+(
+ ID INT(11) NOT NULL,
+ NAME VARCHAR(300) NULL DEFAULT NULL,
+ PRIMARY KEY (ID)
+);
+
+CREATE TABLE IF NOT EXISTS DM_DEVICE
+(
+ ID VARCHAR(20) NOT NULL,
+ DESCRIPTION TEXT NULL DEFAULT NULL,
+ NAME VARCHAR(100) NULL DEFAULT NULL,
+ DATE_OF_ENROLLMENT DATETIME NULL DEFAULT NULL,
+ DATE_OF_LAST_UPDATE DATETIME NULL DEFAULT NULL,
+ OWNERSHIP VARCHAR(45) NULL DEFAULT NULL,
+ STATUS VARCHAR(15) NULL DEFAULT NULL,
+ DEVICE_TYPE_ID INT(11) NULL DEFAULT NULL,
+ DEVICE_IDENTIFICATION VARCHAR(300) NULL DEFAULT NULL,
+ OWNER VARCHAR(45) NULL DEFAULT NULL,
+ PRIMARY KEY (ID),
+ CONSTRAINT fk_DM_DEVICE_DM_DEVICE_TYPE2 FOREIGN KEY (DEVICE_TYPE_ID )
+ REFERENCES DM_DEVICE_TYPE (ID ) ON DELETE NO ACTION ON UPDATE NO ACTION
+);
diff --git a/product/modules/distribution/src/repository/dbscripts/cdm/mysql.sql b/product/modules/distribution/src/repository/dbscripts/cdm/mysql.sql
new file mode 100644
index 00000000000..fc78109c545
--- /dev/null
+++ b/product/modules/distribution/src/repository/dbscripts/cdm/mysql.sql
@@ -0,0 +1,34 @@
+-- -----------------------------------------------------
+-- Table `DM_DEVICE_TYPE`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `DM_DEVICE_TYPE` (
+ `ID` INT(11) NOT NULL ,
+ `NAME` VARCHAR(300) NULL DEFAULT NULL ,
+ PRIMARY KEY (`ID`) )
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;
+
+
+-- -----------------------------------------------------
+-- Table `DM_DEVICE`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `DM_DEVICE` (
+ `ID` VARCHAR(20) NOT NULL ,
+ `DESCRIPTION` TEXT NULL DEFAULT NULL ,
+ `NAME` VARCHAR(100) NULL DEFAULT NULL ,
+ `DATE_OF_ENROLLMENT` DATETIME NULL DEFAULT NULL ,
+ `DATE_OF_LAST_UPDATE` DATETIME NULL DEFAULT NULL ,
+ `OWNERSHIP` VARCHAR(45) NULL DEFAULT NULL ,
+ `STATUS` VARCHAR(15) NULL DEFAULT NULL ,
+ `DEVICE_TYPE_ID` INT(11) NULL DEFAULT NULL ,
+ `DEVICE_IDENTIFICATION` VARCHAR(300) NULL DEFAULT NULL ,
+ `OWNER` VARCHAR(45) NULL DEFAULT NULL ,
+ PRIMARY KEY (`ID`) ,
+ INDEX `fk_DM_DEVICE_DM_DEVICE_TYPE2_idx` (`DEVICE_TYPE_ID` ASC) ,
+ CONSTRAINT `fk_DM_DEVICE_DM_DEVICE_TYPE2`
+ FOREIGN KEY (`DEVICE_TYPE_ID` )
+ REFERENCES `DM_DEVICE_TYPE` (`ID` )
+ ON DELETE NO ACTION
+ ON UPDATE NO ACTION)
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;
diff --git a/product/modules/distribution/src/repository/dbscripts/cdm/mysql.sql~ b/product/modules/distribution/src/repository/dbscripts/cdm/mysql.sql~
new file mode 100644
index 00000000000..fdb62f912f3
--- /dev/null
+++ b/product/modules/distribution/src/repository/dbscripts/cdm/mysql.sql~
@@ -0,0 +1,36 @@
+USE `WSO2CDM_DB`;
+
+-- -----------------------------------------------------
+-- Table `DM_DEVICE_TYPE`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `DM_DEVICE_TYPE` (
+ `ID` INT(11) NOT NULL ,
+ `NAME` VARCHAR(300) NULL DEFAULT NULL ,
+ PRIMARY KEY (`ID`) )
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;
+
+
+-- -----------------------------------------------------
+-- Table `DM_DEVICE`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `DM_DEVICE` (
+ `ID` VARCHAR(20) NOT NULL ,
+ `DESCRIPTION` TEXT NULL DEFAULT NULL ,
+ `NAME` VARCHAR(100) NULL DEFAULT NULL ,
+ `DATE_OF_ENROLLMENT` DATETIME NULL DEFAULT NULL ,
+ `DATE_OF_LAST_UPDATE` DATETIME NULL DEFAULT NULL ,
+ `OWNERSHIP` VARCHAR(45) NULL DEFAULT NULL ,
+ `STATUS` VARCHAR(15) NULL DEFAULT NULL ,
+ `DEVICE_TYPE_ID` INT(11) NULL DEFAULT NULL ,
+ `DEVICE_IDENTIFICATION` VARCHAR(300) NULL DEFAULT NULL ,
+ `OWNER` VARCHAR(45) NULL DEFAULT NULL ,
+ PRIMARY KEY (`ID`) ,
+ INDEX `fk_DM_DEVICE_DM_DEVICE_TYPE2_idx` (`DEVICE_TYPE_ID` ASC) ,
+ CONSTRAINT `fk_DM_DEVICE_DM_DEVICE_TYPE2`
+ FOREIGN KEY (`DEVICE_TYPE_ID` )
+ REFERENCES `DM_DEVICE_TYPE` (`ID` )
+ ON DELETE NO ACTION
+ ON UPDATE NO ACTION)
+ENGINE = InnoDB
+DEFAULT CHARACTER SET = latin1;