|
|
|
@ -94,6 +94,7 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
|
DATE_OF_ENROLMENT TIMESTAMP DEFAULT NULL,
|
|
|
|
|
DATE_OF_LAST_UPDATE TIMESTAMP DEFAULT NULL,
|
|
|
|
|
TENANT_ID INT NOT NULL,
|
|
|
|
|
LAST_BILLED_DATE BIGINT DEFAULT 0,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT fk_dm_device_enrolment FOREIGN KEY (DEVICE_ID) REFERENCES
|
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
|
|
@ -562,3 +563,14 @@ DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
|
|
|
|
ORDER BY TENANT_ID, DEVICE_ID;
|
|
|
|
|
|
|
|
|
|
-- END OF DASHBOARD RELATED VIEWS --
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_BILLING (
|
|
|
|
|
INVOICE_ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER DEFAULT 0,
|
|
|
|
|
DEVICE_ID INTEGER DEFAULT NULL,
|
|
|
|
|
BILLING_START TIMESTAMP NOT NULL,
|
|
|
|
|
BILLING_END TIMESTAMP NOT NULL,
|
|
|
|
|
PRIMARY KEY (INVOICE_ID),
|
|
|
|
|
CONSTRAINT fk_DM_BILLING_DM_DEVICE2 FOREIGN KEY (DEVICE_ID)
|
|
|
|
|
REFERENCES DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
);
|