2018-11-26 15:56:12 +01:00
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `institution`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `institution` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `institution` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`name` VARCHAR(255) NOT NULL,
|
2018-12-20 12:46:13 +01:00
|
|
|
`url_suffix` VARCHAR(45) NULL,
|
|
|
|
`logo_image` MEDIUMTEXT NULL,
|
2019-03-07 16:43:51 +01:00
|
|
|
`theme_name` VARCHAR(45) NULL,
|
2018-12-03 09:09:34 +01:00
|
|
|
`active` INT(1) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
UNIQUE INDEX `name_UNIQUE` (`name` ASC))
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `lms_setup`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `lms_setup` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `lms_setup` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`name` VARCHAR(255) NOT NULL,
|
|
|
|
`lms_type` VARCHAR(45) NOT NULL,
|
|
|
|
`lms_url` VARCHAR(255) NULL,
|
2019-03-11 16:59:28 +01:00
|
|
|
`lms_clientname` VARCHAR(4000) NULL,
|
|
|
|
`lms_clientsecret` VARCHAR(4000) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`lms_rest_api_token` VARCHAR(4000) NULL,
|
2019-11-13 13:26:28 +01:00
|
|
|
`lms_proxy_host` VARCHAR(255) NULL,
|
|
|
|
`lms_proxy_port` INT NULL,
|
2019-10-14 15:41:56 +02:00
|
|
|
`lms_proxy_auth_username` VARCHAR(255) NULL,
|
|
|
|
`lms_proxy_auth_secret` VARCHAR(255) NULL,
|
2018-12-03 09:09:34 +01:00
|
|
|
`active` INT(1) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `setupInstitutionRef_idx` (`institution_id` ASC),
|
|
|
|
CONSTRAINT `setupInstitutionRef`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `exam`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `exam` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `exam` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2018-12-06 17:00:49 +01:00
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`lms_setup_id` BIGINT UNSIGNED NOT NULL,
|
2019-01-15 17:02:14 +01:00
|
|
|
`external_id` VARCHAR(255) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`owner` VARCHAR(255) NOT NULL,
|
|
|
|
`supporter` VARCHAR(4000) NULL COMMENT 'comma separated list of user_uuid',
|
|
|
|
`type` VARCHAR(45) NOT NULL,
|
2019-03-20 14:32:36 +01:00
|
|
|
`quit_password` VARCHAR(4000) NULL,
|
2019-05-24 12:27:30 +02:00
|
|
|
`browser_keys` VARCHAR(4000) NULL,
|
2019-10-28 14:47:38 +01:00
|
|
|
`status` VARCHAR(255) NOT NULL,
|
2019-11-01 13:46:52 +01:00
|
|
|
`lms_seb_restriction` INT(1) NOT NULL,
|
2019-10-28 14:47:38 +01:00
|
|
|
`updating` INT(1) NOT NULL,
|
|
|
|
`lastUpdate` VARCHAR(255) NULL,
|
2018-12-03 09:09:34 +01:00
|
|
|
`active` INT(1) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `lms_setup_key_idx` (`lms_setup_id` ASC),
|
2018-12-06 17:00:49 +01:00
|
|
|
INDEX `institution_key_idx` (`institution_id` ASC),
|
|
|
|
CONSTRAINT `examLmsSetupRef`
|
2018-11-26 15:56:12 +01:00
|
|
|
FOREIGN KEY (`lms_setup_id`)
|
|
|
|
REFERENCES `lms_setup` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2018-12-06 17:00:49 +01:00
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `examInstitutionRef`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2018-11-26 15:56:12 +01:00
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
2020-10-01 08:27:18 +02:00
|
|
|
-- -----------------------------------------------------
|
2020-10-07 15:07:08 +02:00
|
|
|
-- Table `remote_proctoring_room`
|
2020-10-01 08:27:18 +02:00
|
|
|
-- -----------------------------------------------------
|
2020-10-07 15:07:08 +02:00
|
|
|
DROP TABLE IF EXISTS `remote_proctoring_room` ;
|
2020-10-01 08:27:18 +02:00
|
|
|
|
2020-10-07 15:07:08 +02:00
|
|
|
CREATE TABLE IF NOT EXISTS `remote_proctoring_room` (
|
2020-10-01 08:27:18 +02:00
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`exam_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`name` VARCHAR(255) NOT NULL,
|
|
|
|
`size` INT NULL,
|
|
|
|
`subject` VARCHAR(255) NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `proctor_room_exam_id_idx` (`exam_id` ASC),
|
|
|
|
CONSTRAINT `proctorRoomExamRef`
|
|
|
|
FOREIGN KEY (`exam_id`)
|
|
|
|
REFERENCES `exam` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2020-10-07 15:07:08 +02:00
|
|
|
ON UPDATE NO ACTION);
|
2020-10-01 08:27:18 +02:00
|
|
|
|
2018-11-26 15:56:12 +01:00
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `client_connection`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `client_connection` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `client_connection` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-07-02 15:30:24 +02:00
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`exam_id` BIGINT UNSIGNED NULL,
|
|
|
|
`status` VARCHAR(45) NOT NULL,
|
|
|
|
`connection_token` VARCHAR(255) NOT NULL,
|
2019-09-09 12:47:41 +02:00
|
|
|
`exam_user_session_id` VARCHAR(255) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`client_address` VARCHAR(45) NOT NULL,
|
|
|
|
`virtual_client_address` VARCHAR(45) NULL,
|
2019-08-30 12:32:58 +02:00
|
|
|
`creation_time` BIGINT UNSIGNED NOT NULL,
|
2020-10-07 15:07:08 +02:00
|
|
|
`remote_proctoring_room_id` BIGINT UNSIGNED NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `connection_exam_ref_idx` (`exam_id` ASC),
|
2019-07-02 15:30:24 +02:00
|
|
|
INDEX `clientConnectionInstitutionRef_idx` (`institution_id` ASC),
|
2019-12-18 16:21:20 +01:00
|
|
|
INDEX `connectionTokenRef` (`connection_token` ASC),
|
2020-10-07 15:07:08 +02:00
|
|
|
INDEX `clientConnectionProctorRoomRef_idx` (`remote_proctoring_room_id` ASC),
|
2018-11-26 15:56:12 +01:00
|
|
|
CONSTRAINT `clientConnectionExamRef`
|
|
|
|
FOREIGN KEY (`exam_id`)
|
|
|
|
REFERENCES `exam` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2019-07-02 15:30:24 +02:00
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `clientConnectionInstitutionRef`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2020-10-01 08:27:18 +02:00
|
|
|
ON UPDATE NO ACTION,
|
2020-10-07 15:07:08 +02:00
|
|
|
CONSTRAINT `clientConnectionRemoteProctoringRoomRef`
|
|
|
|
FOREIGN KEY (`remote_proctoring_room_id`)
|
|
|
|
REFERENCES `remote_proctoring_room` (`id`)
|
2020-10-01 08:27:18 +02:00
|
|
|
ON DELETE NO ACTION
|
2019-08-30 12:32:58 +02:00
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
2018-11-26 15:56:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `client_event`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `client_event` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `client_event` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-12-12 17:02:57 +01:00
|
|
|
`client_connection_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`type` INT(2) UNSIGNED NOT NULL,
|
2019-07-24 12:46:48 +02:00
|
|
|
`client_time` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`server_time` BIGINT NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`numeric_value` DECIMAL(10,4) NULL,
|
2019-07-24 12:46:48 +02:00
|
|
|
`text` VARCHAR(512) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
2019-12-12 17:02:57 +01:00
|
|
|
INDEX `eventConnectionRef_idx` (`client_connection_id` ASC),
|
2018-11-26 15:56:12 +01:00
|
|
|
CONSTRAINT `eventConnectionRef`
|
2019-12-12 17:02:57 +01:00
|
|
|
FOREIGN KEY (`client_connection_id`)
|
2018-11-26 15:56:12 +01:00
|
|
|
REFERENCES `client_connection` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `indicator`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `indicator` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `indicator` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`exam_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`type` VARCHAR(45) NOT NULL,
|
|
|
|
`name` VARCHAR(45) NOT NULL,
|
2019-04-11 12:15:26 +02:00
|
|
|
`color` VARCHAR(45) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
INDEX `indicator_exam_idx` (`exam_id` ASC),
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
CONSTRAINT `exam_ref`
|
|
|
|
FOREIGN KEY (`exam_id`)
|
|
|
|
REFERENCES `exam` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `configuration_node`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `configuration_node` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `configuration_node` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2019-04-18 12:20:44 +02:00
|
|
|
`template_id` BIGINT UNSIGNED NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`owner` VARCHAR(255) NOT NULL,
|
|
|
|
`name` VARCHAR(255) NOT NULL,
|
|
|
|
`description` VARCHAR(4000) NULL,
|
|
|
|
`type` VARCHAR(45) NULL,
|
2019-04-30 17:09:08 +02:00
|
|
|
`status` VARCHAR(45) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `configurationInstitutionRef_idx` (`institution_id` ASC),
|
|
|
|
CONSTRAINT `configurationInstitutionRef`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `configuration`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `configuration` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `configuration` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-04-11 12:15:26 +02:00
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`configuration_node_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`version` VARCHAR(255) NULL,
|
|
|
|
`version_date` DATETIME NULL,
|
|
|
|
`followup` INT(1) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
2019-04-11 16:59:47 +02:00
|
|
|
INDEX `configurationNodeRef_idx` (`configuration_node_id` ASC),
|
|
|
|
INDEX `config_institution_ref_idx` (`institution_id` ASC),
|
|
|
|
CONSTRAINT `configuration_node_ref`
|
|
|
|
FOREIGN KEY (`configuration_node_id`)
|
|
|
|
REFERENCES `configuration_node` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `config_institution_ref`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
2018-11-26 15:56:12 +01:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `configuration_attribute`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `configuration_attribute` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `configuration_attribute` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`name` VARCHAR(45) NOT NULL,
|
|
|
|
`type` VARCHAR(45) NOT NULL,
|
|
|
|
`parent_id` BIGINT UNSIGNED NULL,
|
|
|
|
`resources` VARCHAR(255) NULL,
|
|
|
|
`validator` VARCHAR(45) NULL,
|
|
|
|
`dependencies` VARCHAR(255) NULL,
|
|
|
|
`default_value` VARCHAR(255) NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `parent_ref_idx` (`parent_id` ASC),
|
|
|
|
CONSTRAINT `parent_ref`
|
|
|
|
FOREIGN KEY (`parent_id`)
|
|
|
|
REFERENCES `configuration_attribute` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `configuration_value`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `configuration_value` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `configuration_value` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-04-11 12:15:26 +02:00
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`configuration_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`configuration_attribute_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`list_index` INT NOT NULL DEFAULT 0,
|
2019-08-30 12:32:58 +02:00
|
|
|
`value` VARCHAR(16000) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
2019-04-11 16:59:47 +02:00
|
|
|
INDEX `configuration_value_ref_idx` (`configuration_id` ASC),
|
2018-11-26 15:56:12 +01:00
|
|
|
INDEX `configuration_attribute_ref_idx` (`configuration_attribute_id` ASC),
|
2019-04-11 16:59:47 +02:00
|
|
|
INDEX `configuration_value_institution_ref_idx` (`institution_id` ASC),
|
2018-11-26 15:56:12 +01:00
|
|
|
CONSTRAINT `configuration_ref`
|
2019-04-11 16:59:47 +02:00
|
|
|
FOREIGN KEY (`configuration_id`)
|
|
|
|
REFERENCES `configuration` (`id`)
|
2018-11-26 15:56:12 +01:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `configuration_value_attribute_ref`
|
|
|
|
FOREIGN KEY (`configuration_attribute_id`)
|
|
|
|
REFERENCES `configuration_attribute` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2019-04-11 16:59:47 +02:00
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `configuration_value_institution_ref`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2018-11-26 15:56:12 +01:00
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
2019-04-30 17:09:08 +02:00
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `view`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `view` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `view` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`name` VARCHAR(255) NULL,
|
2019-05-15 17:01:12 +02:00
|
|
|
`columns` INT NOT NULL,
|
2019-04-30 17:09:08 +02:00
|
|
|
`position` INT NOT NULL,
|
2019-10-15 08:57:42 +02:00
|
|
|
`template_id` BIGINT UNSIGNED NULL,
|
2019-04-30 17:09:08 +02:00
|
|
|
PRIMARY KEY (`id`))
|
|
|
|
;
|
|
|
|
|
|
|
|
|
2018-11-26 15:56:12 +01:00
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `orientation`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `orientation` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `orientation` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`config_attribute_id` BIGINT UNSIGNED NOT NULL,
|
2019-04-18 12:20:44 +02:00
|
|
|
`template_id` BIGINT UNSIGNED NULL,
|
2019-04-30 17:09:08 +02:00
|
|
|
`view_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`group_id` VARCHAR(45) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`x_position` INT UNSIGNED NOT NULL DEFAULT 0,
|
|
|
|
`y_position` INT UNSIGNED NOT NULL DEFAULT 0,
|
|
|
|
`width` INT UNSIGNED NULL,
|
|
|
|
`height` INT UNSIGNED NULL,
|
2019-04-26 20:22:17 +02:00
|
|
|
`title` VARCHAR(45) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `config_attribute_orientation_rev_idx` (`config_attribute_id` ASC),
|
2019-04-30 17:09:08 +02:00
|
|
|
INDEX `orientation_view_ref_idx` (`view_id` ASC),
|
|
|
|
CONSTRAINT `config_attribute_orientation_ref`
|
2018-11-26 15:56:12 +01:00
|
|
|
FOREIGN KEY (`config_attribute_id`)
|
|
|
|
REFERENCES `configuration_attribute` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2019-04-30 17:09:08 +02:00
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `orientation_view_ref`
|
|
|
|
FOREIGN KEY (`view_id`)
|
|
|
|
REFERENCES `view` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2018-11-26 15:56:12 +01:00
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `exam_configuration_map`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `exam_configuration_map` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `exam_configuration_map` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-04-11 12:15:26 +02:00
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`exam_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`configuration_node_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`user_names` VARCHAR(4000) NULL,
|
2019-05-27 08:59:25 +02:00
|
|
|
`encrypt_secret` VARCHAR(255) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
2019-04-11 16:59:47 +02:00
|
|
|
INDEX `exam_ref_idx` (`exam_id` ASC),
|
|
|
|
INDEX `configuration_map_ref_idx` (`configuration_node_id` ASC),
|
|
|
|
INDEX `exam_config_institution_ref_idx` (`institution_id` ASC),
|
2018-11-26 15:56:12 +01:00
|
|
|
CONSTRAINT `exam_map_ref`
|
2019-04-11 16:59:47 +02:00
|
|
|
FOREIGN KEY (`exam_id`)
|
|
|
|
REFERENCES `exam` (`id`)
|
2018-11-26 15:56:12 +01:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `configuration_map_ref`
|
2019-04-11 16:59:47 +02:00
|
|
|
FOREIGN KEY (`configuration_node_id`)
|
|
|
|
REFERENCES `configuration_node` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `exam_config_institution_ref`
|
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
2018-11-26 15:56:12 +01:00
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `user`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `user` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `user` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-03-07 16:43:51 +01:00
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`uuid` VARCHAR(255) NOT NULL,
|
2020-02-05 13:18:22 +01:00
|
|
|
`creation_date` DATETIME NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`name` VARCHAR(255) NOT NULL,
|
2020-01-30 16:19:50 +01:00
|
|
|
`surname` VARCHAR(255) NULL,
|
2018-12-20 16:33:00 +01:00
|
|
|
`username` VARCHAR(255) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`password` VARCHAR(255) NOT NULL,
|
2019-02-25 16:57:37 +01:00
|
|
|
`email` VARCHAR(255) NULL,
|
|
|
|
`language` VARCHAR(45) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
`timeZone` VARCHAR(45) NOT NULL,
|
2018-12-03 09:09:34 +01:00
|
|
|
`active` INT(1) NOT NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `institutionRef_idx` (`institution_id` ASC),
|
2019-03-07 16:43:51 +01:00
|
|
|
CONSTRAINT `userInstitutionRef`
|
2018-11-26 15:56:12 +01:00
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
2018-11-29 17:05:38 +01:00
|
|
|
|
2018-11-26 15:56:12 +01:00
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `user_role`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `user_role` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `user_role` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`user_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`role_name` VARCHAR(45) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `user_ref_idx` (`user_id` ASC),
|
|
|
|
CONSTRAINT `user_ref`
|
|
|
|
FOREIGN KEY (`user_id`)
|
|
|
|
REFERENCES `user` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `oauth_access_token`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `oauth_access_token` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `oauth_access_token` (
|
|
|
|
`token_id` VARCHAR(255) NULL,
|
|
|
|
`token` BLOB NULL,
|
|
|
|
`authentication_id` VARCHAR(255) NULL,
|
|
|
|
`user_name` VARCHAR(255) NULL,
|
|
|
|
`client_id` VARCHAR(255) NULL,
|
|
|
|
`authentication` BLOB NULL,
|
2019-08-09 11:29:18 +02:00
|
|
|
`refresh_token` VARCHAR(255) NULL,
|
|
|
|
UNIQUE INDEX `authentication_id_UNIQUE` (`authentication_id` ASC))
|
2018-11-26 15:56:12 +01:00
|
|
|
;
|
|
|
|
|
2019-08-30 12:32:58 +02:00
|
|
|
|
2018-11-26 15:56:12 +01:00
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `oauth_refresh_token`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `oauth_refresh_token` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `oauth_refresh_token` (
|
|
|
|
`token_id` VARCHAR(255) NULL,
|
|
|
|
`token` BLOB NULL,
|
|
|
|
`authentication` BLOB NULL)
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `threshold`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `threshold` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `threshold` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`indicator_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`value` DECIMAL(10,4) NOT NULL,
|
2019-04-11 12:15:26 +02:00
|
|
|
`color` VARCHAR(45) NULL,
|
2018-11-26 15:56:12 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `indicator_threshold_id_idx` (`indicator_id` ASC),
|
|
|
|
CONSTRAINT `indicator_threshold_id`
|
|
|
|
FOREIGN KEY (`indicator_id`)
|
|
|
|
REFERENCES `indicator` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
2018-11-29 17:05:38 +01:00
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
2018-12-17 16:36:04 +01:00
|
|
|
-- Table `user_activity_log`
|
2018-11-29 17:05:38 +01:00
|
|
|
-- -----------------------------------------------------
|
2018-12-17 16:36:04 +01:00
|
|
|
DROP TABLE IF EXISTS `user_activity_log` ;
|
2018-11-29 17:05:38 +01:00
|
|
|
|
2018-12-17 16:36:04 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `user_activity_log` (
|
2018-11-29 17:05:38 +01:00
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`user_uuid` VARCHAR(255) NOT NULL,
|
|
|
|
`timestamp` BIGINT NOT NULL,
|
2018-12-17 16:36:04 +01:00
|
|
|
`activity_type` VARCHAR(45) NOT NULL,
|
2018-11-29 17:05:38 +01:00
|
|
|
`entity_type` VARCHAR(45) NOT NULL,
|
|
|
|
`entity_id` VARCHAR(255) NOT NULL,
|
2019-07-31 17:34:42 +02:00
|
|
|
`message` VARCHAR(4000) NULL,
|
2018-11-29 17:05:38 +01:00
|
|
|
PRIMARY KEY (`id`))
|
2018-12-03 09:09:34 +01:00
|
|
|
;
|
2019-01-31 09:30:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `additional_attributes`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `additional_attributes` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `additional_attributes` (
|
2019-08-30 12:32:58 +02:00
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
2019-01-31 09:30:18 +01:00
|
|
|
`entity_type` VARCHAR(45) NOT NULL,
|
|
|
|
`entity_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`name` VARCHAR(255) NOT NULL,
|
|
|
|
`value` VARCHAR(4000) NULL,
|
|
|
|
PRIMARY KEY (`id`))
|
|
|
|
;
|
|
|
|
|
2019-04-11 12:15:26 +02:00
|
|
|
|
2019-03-07 16:43:51 +01:00
|
|
|
-- -----------------------------------------------------
|
2019-03-11 16:59:28 +01:00
|
|
|
-- Table `seb_client_configuration`
|
2019-03-07 16:43:51 +01:00
|
|
|
-- -----------------------------------------------------
|
2019-03-11 16:59:28 +01:00
|
|
|
DROP TABLE IF EXISTS `seb_client_configuration` ;
|
2019-03-07 16:43:51 +01:00
|
|
|
|
2019-03-11 16:59:28 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `seb_client_configuration` (
|
2019-03-07 16:43:51 +01:00
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`institution_id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`name` VARCHAR(255) NOT NULL,
|
|
|
|
`date` DATETIME NOT NULL,
|
2019-03-11 16:59:28 +01:00
|
|
|
`client_name` VARCHAR(4000) NOT NULL,
|
|
|
|
`client_secret` VARCHAR(4000) NOT NULL,
|
2019-04-17 10:22:53 +02:00
|
|
|
`encrypt_secret` VARCHAR(255) NULL,
|
2019-03-07 16:43:51 +01:00
|
|
|
`active` INT(1) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `sebClientCredentialsInstitutionRef_idx` (`institution_id` ASC),
|
2019-03-11 16:59:28 +01:00
|
|
|
CONSTRAINT `sebClientConfigInstitutionRef`
|
2019-03-07 16:43:51 +01:00
|
|
|
FOREIGN KEY (`institution_id`)
|
|
|
|
REFERENCES `institution` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION)
|
|
|
|
;
|
|
|
|
|
2019-04-11 12:15:26 +02:00
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `webservice_server_info`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `webservice_server_info` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `webservice_server_info` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL,
|
|
|
|
`uuid` VARCHAR(255) NOT NULL,
|
|
|
|
`service_address` VARCHAR(255) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`))
|
2019-05-24 12:27:30 +02:00
|
|
|
;
|
2019-10-07 13:18:16 +02:00
|
|
|
|
2019-12-12 17:02:57 +01:00
|
|
|
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
-- Table `client_instruction`
|
|
|
|
-- -----------------------------------------------------
|
|
|
|
DROP TABLE IF EXISTS `client_instruction` ;
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `client_instruction` (
|
|
|
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
`exam_id` BIGINT UNSIGNED NOT NULL,
|
2019-12-18 16:21:20 +01:00
|
|
|
`connection_token` VARCHAR(255) NOT NULL,
|
2019-12-12 17:02:57 +01:00
|
|
|
`type` VARCHAR(45) NOT NULL,
|
|
|
|
`attributes` VARCHAR(4000) NULL,
|
2020-08-11 14:23:24 +02:00
|
|
|
`needs_confirmation` INT(1) UNSIGNED NOT NULL DEFAULT 0,
|
|
|
|
`timestamp` BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
2019-12-12 17:02:57 +01:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
INDEX `instructionExamRef_idx` (`exam_id` ASC),
|
2019-12-18 16:21:20 +01:00
|
|
|
INDEX `instructionConnectionRef` (`connection_token` ASC),
|
2019-12-12 17:02:57 +01:00
|
|
|
CONSTRAINT `instructionExamRef`
|
|
|
|
FOREIGN KEY (`exam_id`)
|
|
|
|
REFERENCES `exam` (`id`)
|
|
|
|
ON DELETE NO ACTION
|
2019-12-18 16:21:20 +01:00
|
|
|
ON UPDATE NO ACTION,
|
|
|
|
CONSTRAINT `instructionConnectionRef`
|
|
|
|
FOREIGN KEY (`connection_token`)
|
|
|
|
REFERENCES `client_connection` (`connection_token`)
|
|
|
|
ON DELETE NO ACTION
|
2019-12-12 17:02:57 +01:00
|
|
|
ON UPDATE NO ACTION)
|
2020-10-01 08:27:18 +02:00
|
|
|
;
|
|
|
|
|
|
|
|
|