From 53b0737632bb03d0ae9b70c5a0ea2892123cb2ae Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Thu, 29 Oct 2015 11:52:31 +0530 Subject: [PATCH] Refactored postgresql Db scripts --- .../main/resources/dbscripts/plugins/android/postgresql.sql | 6 ++---- .../src/main/resources/dbscripts/plugins/ios/postgresql.sql | 6 ++---- .../main/resources/dbscripts/plugins/windows/postgresql.sql | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/postgresql.sql index e169deab7..2b3057de3 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/postgresql.sql @@ -1,8 +1,7 @@ -- ----------------------------------------------------- -- Table AD_DEVICE -- ----------------------------------------------------- -DROP TABLE IF EXISTS AD_DEVICE; -CREATE TABLE AD_DEVICE ( +CREATE TABLE IF NOT EXISTS AD_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL , DEVICE_INFO VARCHAR(500) NULL DEFAULT NULL, GCM_TOKEN VARCHAR(45) NULL DEFAULT NULL, @@ -22,8 +21,7 @@ CREATE TABLE AD_DEVICE ( -- ----------------------------------------------------- -- Table AD_FEATURE -- ----------------------------------------------------- -DROP TABLE IF EXISTS AD_FEATURE; -CREATE TABLE AD_FEATURE ( +CREATE TABLE IF NOT EXISTS AD_FEATURE ( ID BIGSERIAL NOT NULL PRIMARY KEY, CODE VARCHAR(45) NOT NULL, NAME VARCHAR(100) NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql index 08fb28def..564e1c3a8 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql @@ -1,8 +1,7 @@ -- ----------------------------------------------------- -- Table IOS_FEATURE -- ----------------------------------------------------- -DROP TABLE IF EXISTS IOS_FEATURE; -CREATE TABLE IOS_FEATURE ( +CREATE TABLE IF NOT EXISTS IOS_FEATURE ( ID SERIAL NOT NULL, CODE VARCHAR(45) NOT NULL, NAME VARCHAR(100) NULL, @@ -13,8 +12,7 @@ CREATE TABLE IOS_FEATURE ( -- ----------------------------------------------------- -- Table IOS_DEVICE -- ----------------------------------------------------- -DROP TABLE IF EXISTS IOS_DEVICE; -CREATE TABLE IF NOT EXISTS IOS_DEVICE ( +CREATE TABLE IF NOT EXISTS IOS_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL, APNS_PUSH_TOKEN VARCHAR(100) NULL DEFAULT NULL, MAGIC_TOKEN VARCHAR(100) NULL DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/postgresql.sql index 0f886bfb5..45754d06f 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/postgresql.sql @@ -1,8 +1,7 @@ -- ----------------------------------------------------- -- Table WIN_DEVICE -- ----------------------------------------------------- -DROP TABLE IF EXISTS WIN_DEVICE; -CREATE TABLE WIN_DEVICE ( +CREATE TABLE IF NOT EXISTS WIN_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL, PUSH_TOKEN VARCHAR(45) NULL DEFAULT NULL, IMEI VARCHAR(45) NULL DEFAULT NULL, @@ -22,8 +21,7 @@ CREATE TABLE WIN_DEVICE ( -- ----------------------------------------------------- -- Table WIN_FEATURE -- ----------------------------------------------------- -DROP TABLE IF EXISTS WIN_FEATURE; -CREATE TABLE WIN_FEATURE ( +CREATE TABLE IF NOT EXISTS WIN_FEATURE ( ID SERIAL NOT NULL, DEVICE_TYPE VARCHAR(45) NOT NULL, CODE VARCHAR(45) NULL,