Fix data type inconsistency in tag db scripts

123
Gimhan Wijayawardana 3 months ago
parent 16365f95a0
commit b8542bfffd

@ -672,7 +672,7 @@ CREATE TABLE IF NOT EXISTS DM_METADATA (
-- DM_TAG TABLE -- -- DM_TAG TABLE --
CREATE TABLE IF NOT EXISTS DM_TAG ( CREATE TABLE IF NOT EXISTS DM_TAG (
ID BIGINT AUTO_INCREMENT, ID INTEGER AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL, NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NULL, DESCRIPTION VARCHAR(255) NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
@ -683,8 +683,8 @@ CREATE TABLE IF NOT EXISTS DM_TAG (
-- DM_DEVICE_TAG_MAPPING TABLE -- -- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID BIGINT NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
TAG_ID BIGINT NOT NULL, TAG_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID), PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID), FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),

@ -878,7 +878,7 @@ CREATE TABLE IF NOT EXISTS DM_CEA_POLICIES (
-- DM_TAG TABLE -- -- DM_TAG TABLE --
CREATE TABLE IF NOT EXISTS DM_TAG ( CREATE TABLE IF NOT EXISTS DM_TAG (
ID BIGINT AUTO_INCREMENT, ID INTEGER AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL, NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NULL, DESCRIPTION VARCHAR(255) NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
@ -889,8 +889,8 @@ CREATE TABLE IF NOT EXISTS DM_TAG (
-- DM_DEVICE_TAG_MAPPING TABLE -- -- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID BIGINT NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
TAG_ID BIGINT NOT NULL, TAG_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID), PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID), FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),

@ -954,19 +954,19 @@ END;
-- DM_TAG TABLE -- -- DM_TAG TABLE --
CREATE TABLE IF NOT EXISTS DM_TAG ( CREATE TABLE IF NOT EXISTS DM_TAG (
ID BIGINT IDENTITY(1,1) PRIMARY KEY, ID INTEGER IDENTITY(1,1) PRIMARY KEY,
NAME NVARCHAR(255) NOT NULL, NAME NVARCHAR(255) NOT NULL,
DESCRIPTION NVARCHAR(255) NULL, DESCRIPTION NVARCHAR(255) NULL,
TENANT_ID INT NOT NULL, TENANT_ID INTEGER NOT NULL,
CONSTRAINT DM_TAG_NAME_TENANT_UNIQUE UNIQUE (NAME, TENANT_ID) CONSTRAINT DM_TAG_NAME_TENANT_UNIQUE UNIQUE (NAME, TENANT_ID)
); );
-- END OF DM_TAG TABLE -- -- END OF DM_TAG TABLE --
-- DM_DEVICE_TAG_MAPPING TABLE -- -- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID BIGINT NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
TAG_ID BIGINT NOT NULL, TAG_ID INTEGER NOT NULL,
TENANT_ID INT NOT NULL, TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID), PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID), FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),
FOREIGN KEY (TAG_ID) REFERENCES DM_TAG(ID) ON DELETE CASCADE FOREIGN KEY (TAG_ID) REFERENCES DM_TAG(ID) ON DELETE CASCADE

@ -953,19 +953,19 @@ CREATE TABLE IF NOT EXISTS DM_CEA_POLICIES (
-- DM_TAG TABLE -- -- DM_TAG TABLE --
CREATE TABLE IF NOT EXISTS DM_TAG ( CREATE TABLE IF NOT EXISTS DM_TAG (
ID BIGINT AUTO_INCREMENT PRIMARY KEY, ID INTEGER AUTO_INCREMENT PRIMARY KEY,
NAME VARCHAR(255) NOT NULL, NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NULL, DESCRIPTION VARCHAR(255) NULL,
TENANT_ID INT NOT NULL, TENANT_ID INTEGER NOT NULL,
CONSTRAINT DM_TAG_NAME_TENANT_UNIQUE UNIQUE (NAME, TENANT_ID) CONSTRAINT DM_TAG_NAME_TENANT_UNIQUE UNIQUE (NAME, TENANT_ID)
); );
-- END OF DM_TAG TABLE -- -- END OF DM_TAG TABLE --
-- DM_DEVICE_TAG_MAPPING TABLE -- -- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID BIGINT NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
TAG_ID BIGINT NOT NULL, TAG_ID INTEGER NOT NULL,
TENANT_ID INT NOT NULL, TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID), PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID), FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),
FOREIGN KEY (TAG_ID) REFERENCES DM_TAG(ID) ON DELETE CASCADE FOREIGN KEY (TAG_ID) REFERENCES DM_TAG(ID) ON DELETE CASCADE

@ -1258,7 +1258,7 @@ END;
-- DM_TAG TABLE -- -- DM_TAG TABLE --
CREATE TABLE DM_TAG ( CREATE TABLE DM_TAG (
ID NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY, ID NUMBER(10) GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY,
NAME VARCHAR2(255) NOT NULL, NAME VARCHAR2(255) NOT NULL,
DESCRIPTION VARCHAR2(255) NULL, DESCRIPTION VARCHAR2(255) NULL,
TENANT_ID NUMBER(10) NOT NULL, TENANT_ID NUMBER(10) NOT NULL,
@ -1268,8 +1268,8 @@ CREATE TABLE DM_TAG (
-- DM_DEVICE_TAG_MAPPING TABLE -- -- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE DM_DEVICE_TAG_MAPPING ( CREATE TABLE DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID NUMBER(19) NOT NULL, ENROLMENT_ID NUMBER(10) NOT NULL,
TAG_ID NUMBER(19) NOT NULL, TAG_ID NUMBER(10) NOT NULL,
TENANT_ID NUMBER(10) NOT NULL, TENANT_ID NUMBER(10) NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID), PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID), FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),

@ -884,7 +884,7 @@ CREATE TABLE IF NOT EXISTS DM_CEA_POLICIES (
-- DM_TAG TABLE -- -- DM_TAG TABLE --
CREATE TABLE IF NOT EXISTS DM_TAG ( CREATE TABLE IF NOT EXISTS DM_TAG (
ID BIGSERIAL PRIMARY KEY, ID INTEGER PRIMARY KEY,
NAME VARCHAR(255) NOT NULL, NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255) NULL, DESCRIPTION VARCHAR(255) NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
@ -894,8 +894,8 @@ CREATE TABLE IF NOT EXISTS DM_TAG (
-- DM_DEVICE_TAG_MAPPING TABLE -- -- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING ( CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID BIGINT NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
TAG_ID BIGINT NOT NULL, TAG_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID), PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID), FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),

Loading…
Cancel
Save