Refactored postgresql DB Scripts

revert-dabc3590
Dileesha Rajapakse 9 years ago
parent 1aee8edace
commit e600627f78

@ -1,7 +1,8 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table AD_DEVICE -- Table AD_DEVICE
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AD_DEVICE ( DROP TABLE IF EXISTS AD_DEVICE;
CREATE TABLE AD_DEVICE (
DEVICE_ID VARCHAR(45) NOT NULL , DEVICE_ID VARCHAR(45) NOT NULL ,
DEVICE_INFO VARCHAR(500) NULL DEFAULT NULL, DEVICE_INFO VARCHAR(500) NULL DEFAULT NULL,
GCM_TOKEN VARCHAR(45) NULL DEFAULT NULL, GCM_TOKEN VARCHAR(45) NULL DEFAULT NULL,
@ -21,10 +22,10 @@ CREATE TABLE IF NOT EXISTS AD_DEVICE (
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table AD_FEATURE -- Table AD_FEATURE
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AD_FEATURE ( DROP TABLE IF EXISTS AD_FEATURE;
ID INT NOT NULL AUTO_INCREMENT, CREATE TABLE AD_FEATURE (
ID BIGSERIAL NOT NULL PRIMARY KEY,
CODE VARCHAR(45) NOT NULL, CODE VARCHAR(45) NOT NULL,
NAME VARCHAR(100) NULL, NAME VARCHAR(100) NULL,
DESCRIPTION VARCHAR(200) NULL, DESCRIPTION VARCHAR(200) NULL
PRIMARY KEY (ID)
); );

@ -0,0 +1,30 @@
-- -----------------------------------------------------
-- 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,
IMEI VARCHAR(45) NULL DEFAULT NULL,
IMSI VARCHAR(45) NULL DEFAULT NULL,
OS_VERSION VARCHAR(45) NULL DEFAULT NULL,
DEVICE_MODEL VARCHAR(45) NULL DEFAULT NULL,
VENDOR VARCHAR(45) NULL DEFAULT NULL,
LATITUDE VARCHAR(45) NULL DEFAULT NULL,
LONGITUDE VARCHAR(45) NULL DEFAULT NULL,
SERIAL VARCHAR(45) NULL DEFAULT NULL,
MAC_ADDRESS VARCHAR(45) NULL DEFAULT NULL,
DEVICE_NAME VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (DEVICE_ID)
);
-- -----------------------------------------------------
-- Table AD_FEATURE
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AD_FEATURE (
ID INT NOT NULL AUTO_INCREMENT,
CODE VARCHAR(45) NOT NULL,
NAME VARCHAR(100) NULL,
DESCRIPTION VARCHAR(200) NULL,
PRIMARY KEY (ID)
);

@ -1,7 +1,8 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table IOS_FEATURE -- Table IOS_FEATURE
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS IOS_FEATURE ( DROP TABLE IF EXISTS IOS_FEATURE;
CREATE TABLE IOS_FEATURE (
ID SERIAL NOT NULL, ID SERIAL NOT NULL,
CODE VARCHAR(45) NOT NULL, CODE VARCHAR(45) NOT NULL,
NAME VARCHAR(100) NULL, NAME VARCHAR(100) NULL,
@ -12,6 +13,7 @@ CREATE TABLE IF NOT EXISTS IOS_FEATURE (
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table IOS_DEVICE -- 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, DEVICE_ID VARCHAR(45) NOT NULL,
APNS_PUSH_TOKEN VARCHAR(100) NULL DEFAULT NULL, APNS_PUSH_TOKEN VARCHAR(100) NULL DEFAULT NULL,

@ -1,7 +1,8 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table WIN_DEVICE -- Table WIN_DEVICE
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS WIN_DEVICE ( DROP TABLE IF EXISTS WIN_DEVICE;
CREATE TABLE WIN_DEVICE (
DEVICE_ID VARCHAR(45) NOT NULL, DEVICE_ID VARCHAR(45) NOT NULL,
PUSH_TOKEN VARCHAR(45) NULL DEFAULT NULL, PUSH_TOKEN VARCHAR(45) NULL DEFAULT NULL,
IMEI VARCHAR(45) NULL DEFAULT NULL, IMEI VARCHAR(45) NULL DEFAULT NULL,
@ -21,7 +22,8 @@ CREATE TABLE IF NOT EXISTS WIN_DEVICE (
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table WIN_FEATURE -- Table WIN_FEATURE
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS WIN_FEATURE ( DROP TABLE IF EXISTS WIN_FEATURE;
CREATE TABLE WIN_FEATURE (
ID SERIAL NOT NULL, ID SERIAL NOT NULL,
DEVICE_TYPE VARCHAR(45) NOT NULL, DEVICE_TYPE VARCHAR(45) NOT NULL,
CODE VARCHAR(45) NULL, CODE VARCHAR(45) NULL,

Loading…
Cancel
Save