feat: expand client jobcard and reporting workflows
This commit is contained in:
+8
-1
@@ -58,11 +58,18 @@ CREATE TABLE IF NOT EXISTS client_contacts (
|
||||
email VARCHAR(190) NULL,
|
||||
phone VARCHAR(60) NULL,
|
||||
is_primary BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
primary_client_id BIGINT UNSIGNED AS (IF(is_primary, client_id, NULL)) STORED,
|
||||
notes TEXT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (client_id) REFERENCES clients(id) ON DELETE CASCADE,
|
||||
INDEX contacts_client_idx (client_id)
|
||||
INDEX contacts_client_idx (client_id),
|
||||
UNIQUE KEY one_primary_contact (primary_client_id)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS jobcard_sequences (
|
||||
sequence_year SMALLINT UNSIGNED PRIMARY KEY,
|
||||
next_sequence INT UNSIGNED NOT NULL
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sla_agreements (
|
||||
|
||||
Reference in New Issue
Block a user