From 6987312e23bd3803bd74d08c2b437301db278d77 Mon Sep 17 00:00:00 2001 From: samisa-abeysinghe Date: Sat, 22 Oct 2022 05:38:34 +0530 Subject: [PATCH] Improved prospect and consent active logic --- db/schema/5-vacancy_and_evaluations.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/schema/5-vacancy_and_evaluations.sql b/db/schema/5-vacancy_and_evaluations.sql index 29e47f5..d9f0faf 100644 --- a/db/schema/5-vacancy_and_evaluations.sql +++ b/db/schema/5-vacancy_and_evaluations.sql @@ -145,6 +145,7 @@ CREATE TABLE IF NOT EXISTS work_experience_evaluation ( CREATE TABLE IF NOT EXISTS applicant_consent ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + active BOOLEAN NOT NULL DEFAULT TRUE, organization_id INT DEFAULT NULL, avinya_type_id INT DEFAULT NULL, person_id INT DEFAULT NULL, @@ -162,17 +163,16 @@ CREATE TABLE IF NOT EXISTS applicant_consent ( FOREIGN KEY (person_id) REFERENCES person(id), FOREIGN KEY (organization_id) REFERENCES organization(id), FOREIGN KEY (avinya_type_id) REFERENCES avinya_type(id), - FOREIGN KEY (application_id) REFERENCES application(id), - UNIQUE (phone, email) + FOREIGN KEY (application_id) REFERENCES application(id) ); CREATE TABLE IF NOT EXISTS prospect ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + active BOOLEAN NOT NULL DEFAULT TRUE, name VARCHAR(100) NOT NULL DEFAULT 'Anon', phone INT NOT NULL DEFAULT 0, email VARCHAR(254) DEFAULT 'me@you.com', send_information_consent BOOL DEFAULT FALSE, agree_terms_consent BOOL DEFAULT FALSE, - created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - UNIQUE (phone, email) + created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP );