Project

General

Profile

Actions

Bug #11845

closed

Error when executing sql query for creating DM_DEVICE_TAG_MAPPING table against SQL DB

Added by Arshana Atapattu 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
High
Start date:
29/08/2024
Due date:
30/08/2024
% Done:

100%

Estimated time:
0:30 h
Spent time:
Device Type:
Component:
Type:

Description

Cannot execute the query for creating the table DM_DEVICE_TAG_MAPPING with sql DB
it throws a incompatible error [1]

Code location: https://repository.entgra.net/community/device-mgt-core/src/commit/cfa40c0d2be0c6b58c94941f42ca2c7a3ebe81bd/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql#L965

Query: [2]

Related PR: https://repository.entgra.net/community/device-mgt-core/pulls/492/files

[1]
[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

Screenshot from 2024-08-29 08-42-30.png (101 KB) Screenshot from 2024-08-29 08-42-30.png [1] Arshana Atapattu, 29/08/2024 11:05 AM
Actions

Also available in: Atom PDF