diff options
Diffstat (limited to 'populate.sql')
-rw-r--r-- | populate.sql | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/populate.sql b/populate.sql index f94da2f..a78cfd5 100644 --- a/populate.sql +++ b/populate.sql @@ -11,6 +11,7 @@ USE ded; SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS organisations; DROP TABLE IF EXISTS operations; +DROP TABLE IF EXISTS engagement_strategies; SET FOREIGN_KEY_CHECKS = 1; /* Create the Organisations table. */ @@ -45,10 +46,31 @@ CREATE TABLE operations ( /* Add index to created column. */ CREATE INDEX idx_operations_created ON operations(created); +CREATE TABLE engagement_strategies ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + valid_from DATETIME NOT NULL, + valid_to DATETIME NOT NULL, + description VARCHAR(255) NULL, + operation_id INT NOT NULL, + created DATETIME NOT NULL, + CONSTRAINT fk_es_operation + FOREIGN KEY(operation_id) + REFERENCES operations(id) + ON DELETE CASCADE + ON UPDATE RESTRICT +); + +CREATE INDEX idx_engagement_strategy_created ON engagement_strategies(created); + + +/* Create some operations */ INSERT INTO operations (name, created, description, organisation_id) VALUES ("Operation 1", UTC_TIMESTAMP(), "Operation 1 Description", 1); INSERT INTO operations (name, created, description, organisation_id) VALUES ("Operation 2", UTC_TIMESTAMP(), "Operation 2 Description", 1); INSERT INTO operations (name, created, description, organisation_id) VALUES ("Operation 3", UTC_TIMESTAMP(), "Operation 3 Description", 2); +/* Create some ESs */ +INSERT INTO engagement_strategies (valid_from, valid_to, operation_id, created) VALUES ("2023-01-01", "2025-01-01", 1, UTC_TIMESTAMP()); + /* /1* The following should be carried out on the database server *1/ */ |