Merge pull request #17 from dilee/master

Fixed DB Scripts
merge-requests/1/head
Lakshitha Harshan 9 years ago
commit 3b9e04c7bf

@ -3,7 +3,7 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE AD_DEVICE ( CREATE TABLE AD_DEVICE (
DEVICE_ID VARCHAR(45) NOT NULL , DEVICE_ID VARCHAR(45) NOT NULL ,
DEVICE_INFO VARCHAR(500) DEFAULT NULL, DEVICE_INFO VARCHAR(1000) DEFAULT NULL,
GCM_TOKEN VARCHAR(45) DEFAULT NULL, GCM_TOKEN VARCHAR(45) DEFAULT NULL,
IMEI VARCHAR(45) DEFAULT NULL, IMEI VARCHAR(45) DEFAULT NULL,
IMSI VARCHAR(45) DEFAULT NULL, IMSI VARCHAR(45) DEFAULT NULL,
@ -15,8 +15,8 @@ CREATE TABLE AD_DEVICE (
SERIAL VARCHAR(45) DEFAULT NULL, SERIAL VARCHAR(45) DEFAULT NULL,
MAC_ADDRESS VARCHAR(45) DEFAULT NULL, MAC_ADDRESS VARCHAR(45) DEFAULT NULL,
DEVICE_NAME VARCHAR(100) DEFAULT NULL, DEVICE_NAME VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (DEVICE_ID) CONSTRAINT PK_AD_DEVICE PRIMARY KEY (DEVICE_ID)
); )
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -27,23 +27,24 @@ CREATE TABLE AD_FEATURE (
CODE VARCHAR(45) NOT NULL, CODE VARCHAR(45) NOT NULL,
NAME VARCHAR(100) NOT NULL, NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(200) DEFAULT NULL, DESCRIPTION VARCHAR(200) DEFAULT NULL,
PRIMARY KEY (ID) CONSTRAINT AD_FEATURE PRIMARY KEY (ID)
); )
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Sequence `AD_FEATURE_ID_INC_SEQ` -- Sequence `AD_FEATURE_ID_INC_SEQ`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE SEQUENCE AD_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE; CREATE SEQUENCE AD_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Trigger `AD_FEATURE_ID_INC_TRIG` -- Trigger `AD_FEATURE_ID_INC_TRIG`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE OR REPLACE TRIGGER AD_FEATURE_ID_INC_TRIG CREATE OR REPLACE TRIGGER AD_FEATURE_ID_INC_TRIG
BEFORE INSERT ON AD_FEATURE BEFORE INSERT
ON AD_FEATURE
REFERENCING NEW AS NEW
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SELECT AD_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; SELECT AD_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END; END;
/ /

@ -3,7 +3,7 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AD_DEVICE ( CREATE TABLE IF NOT EXISTS AD_DEVICE (
DEVICE_ID VARCHAR(45) NOT NULL , DEVICE_ID VARCHAR(45) NOT NULL ,
DEVICE_INFO VARCHAR(500) NULL DEFAULT NULL, DEVICE_INFO TEXT NULL DEFAULT NULL,
GCM_TOKEN VARCHAR(45) NULL DEFAULT NULL, GCM_TOKEN VARCHAR(45) NULL DEFAULT NULL,
IMEI VARCHAR(45) NULL DEFAULT NULL, IMEI VARCHAR(45) NULL DEFAULT NULL,
IMSI VARCHAR(45) NULL DEFAULT NULL, IMSI VARCHAR(45) NULL DEFAULT NULL,
@ -22,9 +22,8 @@ CREATE TABLE IF NOT EXISTS AD_DEVICE (
-- Table AD_FEATURE -- Table AD_FEATURE
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS AD_FEATURE ( CREATE TABLE IF NOT EXISTS AD_FEATURE (
ID INT NOT NULL AUTO_INCREMENT, 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)
); );

@ -1,7 +1,7 @@
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `IOS_DEVICE` -- Table `IOS_DEVICE`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IOS_DEVICE ( CREATE TABLE IOS_DEVICE (
MOBILE_DEVICE_ID VARCHAR(45) NOT NULL, MOBILE_DEVICE_ID VARCHAR(45) NOT NULL,
APNS_PUSH_TOKEN VARCHAR(100) DEFAULT NULL, APNS_PUSH_TOKEN VARCHAR(100) DEFAULT NULL,
MAGIC_TOKEN VARCHAR(100) DEFAULT NULL, MAGIC_TOKEN VARCHAR(100) DEFAULT NULL,
@ -18,8 +18,8 @@
ICCID VARCHAR(45) DEFAULT NULL, ICCID VARCHAR(45) DEFAULT NULL,
LATITUDE VARCHAR(45) DEFAULT NULL, LATITUDE VARCHAR(45) DEFAULT NULL,
LONGITUDE VARCHAR(45) DEFAULT NULL, LONGITUDE VARCHAR(45) DEFAULT NULL,
PRIMARY KEY (MOBILE_DEVICE_ID) CONSTRAINT PK_IOS_DEVICE PRIMARY KEY (MOBILE_DEVICE_ID)
); )
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -30,8 +30,8 @@ CREATE TABLE IOS_FEATURE (
CODE VARCHAR(45) NOT NULL, CODE VARCHAR(45) NOT NULL,
NAME VARCHAR(100) NOT NULL, NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(200) NULL, DESCRIPTION VARCHAR(200) NULL,
PRIMARY KEY (ID) CONSTRAINT PK_IOS_FEATURE PRIMARY KEY (ID)
); )
/ /
-- Sequence `IOS_FEATURE_ID_INC_SEQ` -- Sequence `IOS_FEATURE_ID_INC_SEQ`
@ -43,9 +43,11 @@ CREATE SEQUENCE IOS_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE;
-- Trigger `IOS_FEATURE_ID_INC_TRIG` -- Trigger `IOS_FEATURE_ID_INC_TRIG`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE OR REPLACE TRIGGER IOS_FEATURE_ID_INC_TRIG CREATE OR REPLACE TRIGGER IOS_FEATURE_ID_INC_TRIG
BEFORE INSERT ON IOS_FEATURE BEFORE INSERT
ON IOS_FEATURE
REFERENCING NEW AS NEW
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END; END;
/ /

@ -16,7 +16,7 @@ CREATE TABLE WIN_DEVICE (
UNLOCK_TOKEN VARCHAR(2000) DEFAULT NULL, UNLOCK_TOKEN VARCHAR(2000) DEFAULT NULL,
SERIAL VARCHAR(45) DEFAULT NULL, SERIAL VARCHAR(45) DEFAULT NULL,
PRIMARY KEY (DEVICE_ID) PRIMARY KEY (DEVICE_ID)
); )
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -28,22 +28,24 @@ CREATE TABLE WIN_FEATURE (
NAME VARCHAR(100) NOT NULL, NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(200) NULL, DESCRIPTION VARCHAR(200) NULL,
PRIMARY KEY (ID) PRIMARY KEY (ID)
); )
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Sequence `WIN_FEATURE_ID_INC_SEQ` -- Sequence `WIN_FEATURE_ID_INC_SEQ`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE SEQUENCE WIN_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE; CREATE SEQUENCE WIN_FEATURE_ID_INC_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
/ /
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Trigger `WIN_FEATURE_ID_INC_TRIG` -- Trigger `WIN_FEATURE_ID_INC_TRIG`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE OR REPLACE TRIGGER WIN_FEATURE_ID_INC_TRIG CREATE OR REPLACE TRIGGER WIN_FEATURE_ID_INC_TRIG
BEFORE INSERT ON WIN_FEATURE BEFORE INSERT
ON WIN_FEATURE
REFERENCING NEW AS NEW
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SELECT WIN_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; SELECT WIN_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END; END;
/ /
Loading…
Cancel
Save