Bug #11845
closedError when executing sql query for creating DM_DEVICE_TAG_MAPPING table against SQL DB
Description
Cannot execute the query for creating the table DM_DEVICE_TAG_MAPPING with sql DB
it throws a incompatible error [1]
Query: [2]
Related PR: https://repository.entgra.net/community/device-mgt-core/pulls/492/files
[1]
[2]
-- DM_TAG TABLE --
CREATE TABLE IF NOT EXISTS DM_TAG (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
NAME VARCHAR NOT NULL,
DESCRIPTION VARCHAR NULL,
TENANT_ID INT NOT NULL,
CONSTRAINT DM_TAG_NAME_TENANT_UNIQUE UNIQUE (NAME, TENANT_ID)
);
-- END OF DM_TAG TABLE --
-- DM_DEVICE_TAG_MAPPING TABLE --
CREATE TABLE IF NOT EXISTS DM_DEVICE_TAG_MAPPING (
ENROLMENT_ID BIGINT NOT NULL,
TAG_ID BIGINT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY (ENROLMENT_ID, TAG_ID, TENANT_ID),
FOREIGN KEY (ENROLMENT_ID) REFERENCES DM_ENROLMENT(ID),
FOREIGN KEY (TAG_ID) REFERENCES DM_TAG(ID) ON DELETE CASCADE
);
-- END OF DM_DEVICE_TAG_MAPPING TABLE --
Files