diff --git a/src-electron/db/zap-schema.sql b/src-electron/db/zap-schema.sql index ee744b5d23..3481fca9b9 100644 --- a/src-electron/db/zap-schema.sql +++ b/src-electron/db/zap-schema.sql @@ -357,17 +357,17 @@ CREATE TABLE IF NOT EXISTS "DEVICE_TYPE" ( ); /* This table stores information about endpoint compositions. - Each record represents a composition associated with a specific package. + Each record represents a composition associated with a specific device type. Columns: ENDPOINT_COMPOSITION_ID: The primary key of the table, auto-incremented for each new record. - PACKAGE_REF: A foreign key linking to the PACKAGE table, indicating the package associated with this composition. + DEVICE_TYPE_REF: A foreign key linking to the DEVICE_TYPE table, indicating the device type associated with this composition. TYPE: A text field describing the type of the endpoint composition. CODE: An integer representing a unique code for the endpoint composition. Foreign Key Constraints: - The PACKAGE_REF column references the PACKAGE_ID column of the PACKAGE table. - On deletion or update of a referenced package, corresponding records in this table are cascaded accordingly. + The DEVICE_TYPE_REF column references the DEVICE_TYPE_ID column of the DEVICE_TYPE table. + On deletion of a referenced device type, corresponding records in this table are deleted (CASCADE). */ CREATE TABLE IF NOT EXISTS "ENDPOINT_COMPOSITION" ( "ENDPOINT_COMPOSITION_ID" integer PRIMARY KEY AUTOINCREMENT, @@ -378,19 +378,18 @@ CREATE TABLE IF NOT EXISTS "ENDPOINT_COMPOSITION" ( ); /* This table defines the composition of devices within the system. - It links devices to their endpoint compositions and specifies their conformance and constraints. + It links devices to their types and endpoint compositions, specifying their conformance and constraints. Columns: DEVICE_COMPOSITION_ID: The primary key of the table, auto-incremented for each new record. - PACKAGE_REF: A foreign key that references the PACKAGE table, indicating the package associated with this device composition. - DEVICE_REF: An integer that acts as a foreign key to reference a specific device. + DEVICE_TYPE_REF: An integer that acts as a foreign key to reference a specific device type. ENDPOINT_COMPOSITION_REF: A foreign key linking to the ENDPOINT_COMPOSITION table to specify the endpoint composition associated with this device. CONFORMANCE: A text field describing the conformance level of the device composition. CONSTRAINT: An integer representing any constraints applied to the device composition. Foreign Key Constraints: + The DEVICE_TYPE_REF column references the DEVICE_TYPE_ID column of the DEVICE_TYPE table. On deletion of a device type, corresponding records in this table are deleted (CASCADE). The ENDPOINT_COMPOSITION_REF column references the ENDPOINT_COMPOSITION_ID column of the ENDPOINT_COMPOSITION table. On deletion of an endpoint composition, corresponding records in this table are deleted (CASCADE). - The PACKAGE_REF column references the PACKAGE_ID column of the PACKAGE table. On deletion or update of a referenced package, corresponding records in this table are cascaded accordingly. */ CREATE TABLE IF NOT EXISTS "DEVICE_COMPOSITION" ( "DEVICE_COMPOSITION_ID" integer PRIMARY KEY AUTOINCREMENT,