2020-06-22 14:30:26 +02:00
|
|
|
-- MySQL dump 10.16 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64)
|
|
|
|
--
|
|
|
|
-- Host: localhost Database: cerebrate
|
|
|
|
-- ------------------------------------------------------
|
|
|
|
-- Server version 10.1.44-MariaDB-0ubuntu0.18.04.1
|
|
|
|
|
|
|
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
|
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
|
|
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
|
|
|
/*!40101 SET NAMES utf8mb4 */;
|
|
|
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
|
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
|
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
|
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
|
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `alignment_tags`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `alignment_tags` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`alignment_id` int(10) unsigned NOT NULL,
|
|
|
|
`tag_id` int(10) unsigned NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `alignment_id` (`alignment_id`),
|
|
|
|
KEY `tag_id` (`tag_id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_1` FOREIGN KEY (`alignment_id`) REFERENCES `alignments` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_10` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_11` FOREIGN KEY (`alignment_id`) REFERENCES `alignments` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_12` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_3` FOREIGN KEY (`alignment_id`) REFERENCES `alignments` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_4` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_5` FOREIGN KEY (`alignment_id`) REFERENCES `alignments` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_6` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_7` FOREIGN KEY (`alignment_id`) REFERENCES `alignments` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_8` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
|
|
|
|
CONSTRAINT `alignment_tags_ibfk_9` FOREIGN KEY (`alignment_id`) REFERENCES `alignments` (`id`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `alignments`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `alignments` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`individual_id` int(10) unsigned NOT NULL,
|
|
|
|
`organisation_id` int(10) unsigned NOT NULL,
|
|
|
|
`type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'member',
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `individual_id` (`individual_id`),
|
|
|
|
KEY `organisation_id` (`organisation_id`),
|
|
|
|
CONSTRAINT `alignments_ibfk_1` FOREIGN KEY (`individual_id`) REFERENCES `individuals` (`id`),
|
|
|
|
CONSTRAINT `alignments_ibfk_2` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`)
|
2020-09-28 01:25:07 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `auth_keys`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `auth_keys` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
|
2020-09-28 01:25:07 +02:00
|
|
|
`authkey` varchar(72) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`authkey_start` varchar(4) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`authkey_end` varchar(4) CHARACTER SET ascii DEFAULT NULL,
|
2020-06-22 14:30:26 +02:00
|
|
|
`created` int(10) unsigned NOT NULL,
|
2020-09-28 01:25:07 +02:00
|
|
|
`expiration` int(10) unsigned NOT NULL,
|
2020-06-22 14:30:26 +02:00
|
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
|
|
`comment` text COLLATE utf8mb4_unicode_ci,
|
|
|
|
PRIMARY KEY (`id`),
|
2020-09-28 01:25:07 +02:00
|
|
|
KEY `authkey_start` (`authkey_start`),
|
|
|
|
KEY `authkey_end` (`authkey_end`),
|
2020-06-22 14:30:26 +02:00
|
|
|
KEY `created` (`created`),
|
2020-09-28 01:25:07 +02:00
|
|
|
KEY `expiration` (`expiration`),
|
|
|
|
KEY `user_id` (`user_id`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `broods`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `broods` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`description` text COLLATE utf8mb4_unicode_ci,
|
|
|
|
`organisation_id` int(10) unsigned NOT NULL,
|
|
|
|
`trusted` tinyint(1) DEFAULT NULL,
|
|
|
|
`pull` tinyint(1) DEFAULT NULL,
|
2020-09-28 01:25:07 +02:00
|
|
|
`skip_proxy` tinyint(1) DEFAULT NULL,
|
2020-06-22 14:30:26 +02:00
|
|
|
`authkey` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `name` (`name`),
|
|
|
|
KEY `url` (`url`),
|
|
|
|
KEY `authkey` (`authkey`),
|
2020-09-28 01:25:07 +02:00
|
|
|
KEY `organisation_id` (`organisation_id`),
|
|
|
|
FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`)
|
2020-06-22 14:30:26 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `encryption_keys`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `encryption_keys` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`encryption_key` text COLLATE utf8mb4_unicode_ci,
|
|
|
|
`revoked` tinyint(1) DEFAULT NULL,
|
|
|
|
`expires` int(10) unsigned DEFAULT NULL,
|
|
|
|
`owner_id` int(10) unsigned DEFAULT NULL,
|
|
|
|
`owner_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `type` (`type`),
|
|
|
|
KEY `expires` (`expires`)
|
2020-09-28 01:25:07 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `individual_encryption_keys`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `individual_encryption_keys` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`individual_id` int(10) unsigned NOT NULL,
|
|
|
|
`encryption_key_id` int(10) unsigned NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `individual_id` (`individual_id`),
|
|
|
|
KEY `encryption_key_id` (`encryption_key_id`),
|
|
|
|
CONSTRAINT `individual_encryption_keys_ibfk_1` FOREIGN KEY (`individual_id`) REFERENCES `individuals` (`id`),
|
|
|
|
CONSTRAINT `individual_encryption_keys_ibfk_2` FOREIGN KEY (`encryption_key_id`) REFERENCES `encryption_keys` (`id`),
|
|
|
|
CONSTRAINT `individual_encryption_keys_ibfk_3` FOREIGN KEY (`individual_id`) REFERENCES `individuals` (`id`),
|
|
|
|
CONSTRAINT `individual_encryption_keys_ibfk_4` FOREIGN KEY (`encryption_key_id`) REFERENCES `encryption_keys` (`id`),
|
|
|
|
CONSTRAINT `individual_encryption_keys_ibfk_5` FOREIGN KEY (`individual_id`) REFERENCES `individuals` (`id`),
|
|
|
|
CONSTRAINT `individual_encryption_keys_ibfk_6` FOREIGN KEY (`encryption_key_id`) REFERENCES `encryption_keys` (`id`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `individuals`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `individuals` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`first_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`last_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`position` text COLLATE utf8mb4_unicode_ci,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `email` (`email`),
|
|
|
|
KEY `first_name` (`first_name`),
|
|
|
|
KEY `last_name` (`last_name`)
|
2020-09-28 01:25:07 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
2021-04-30 23:59:53 +02:00
|
|
|
--
|
|
|
|
-- Table structure for table `local_tools`
|
|
|
|
--
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `local_tools` (
|
2021-04-30 23:59:53 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`connector` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`settings` text COLLATE utf8mb4_unicode_ci,
|
2021-06-01 21:30:59 +02:00
|
|
|
`exposed` tinyint(1) NOT NULL,
|
|
|
|
`description` text COLLATE utf8mb4_unicode_ci,
|
2021-04-30 23:59:53 +02:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `name` (`name`),
|
|
|
|
KEY `connector` (`connector`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
2020-06-22 14:30:26 +02:00
|
|
|
--
|
|
|
|
-- Table structure for table `organisation_encryption_keys`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `organisation_encryption_keys` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`organisation_id` int(10) unsigned NOT NULL,
|
|
|
|
`encryption_key_id` int(10) unsigned NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `organisation_id` (`organisation_id`),
|
|
|
|
KEY `encryption_key_id` (`encryption_key_id`),
|
|
|
|
CONSTRAINT `organisation_encryption_keys_ibfk_1` FOREIGN KEY (`organisation_id`) REFERENCES `organisations` (`id`),
|
|
|
|
CONSTRAINT `organisation_encryption_keys_ibfk_2` FOREIGN KEY (`encryption_key_id`) REFERENCES `encryption_keys` (`id`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `organisations`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `organisations` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
|
|
`nationality` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
|
|
`sector` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
|
|
`type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
|
|
`contacts` text COLLATE utf8mb4_unicode_ci,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `name` (`name`),
|
|
|
|
KEY `url` (`url`),
|
|
|
|
KEY `nationality` (`nationality`),
|
|
|
|
KEY `sector` (`sector`),
|
|
|
|
KEY `type` (`type`)
|
2020-09-28 01:25:07 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `roles`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `roles` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`is_default` tinyint(1) DEFAULT NULL,
|
|
|
|
`perm_admin` tinyint(1) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `name` (`name`),
|
|
|
|
KEY `uuid` (`uuid`)
|
2020-09-28 01:25:07 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `tags`
|
|
|
|
--
|
|
|
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `tags` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`description` text COLLATE utf8mb4_unicode_ci,
|
|
|
|
`colour` varchar(6) CHARACTER SET ascii NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `name` (`name`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table `users`
|
|
|
|
--
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `users` (
|
2020-06-22 14:30:26 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
|
|
`password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
|
|
`role_id` int(11) unsigned NOT NULL,
|
|
|
|
`individual_id` int(11) unsigned NOT NULL,
|
|
|
|
`disabled` tinyint(1) DEFAULT '0',
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `role_id` (`role_id`),
|
|
|
|
KEY `individual_id` (`individual_id`),
|
|
|
|
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`),
|
|
|
|
CONSTRAINT `users_ibfk_2` FOREIGN KEY (`individual_id`) REFERENCES `individuals` (`id`)
|
2020-06-25 01:43:00 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `sharing_groups` (
|
2020-06-25 01:43:00 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
|
|
|
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
|
|
`releasability` text DEFAULT NULL,
|
|
|
|
`description` text DEFAULT NULL,
|
|
|
|
`organisation_id` int(10) unsigned NOT NULL,
|
|
|
|
`user_id` int(10) unsigned NOT NULL,
|
|
|
|
`active` tinyint(1) DEFAULT '1',
|
|
|
|
`local` tinyint(1) DEFAULT '1',
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `user_id` (`user_id`),
|
|
|
|
KEY `organisation_id` (`organisation_id`),
|
|
|
|
KEY `name` (`name`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `sgo` (
|
2020-09-28 01:25:07 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
2020-06-25 01:43:00 +02:00
|
|
|
`sharing_group_id` int(10) unsigned NOT NULL,
|
|
|
|
`organisation_id` int(10) unsigned NOT NULL,
|
|
|
|
`deleted` tinyint(1) DEFAULT 0,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `sharing_group_id` (`sharing_group_id`),
|
|
|
|
KEY `organisation_id` (`organisation_id`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `meta_fields` (
|
2020-09-28 01:25:07 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`scope` varchar(191) NOT NULL,
|
|
|
|
`parent_id` int(10) unsigned NOT NULL,
|
|
|
|
`field` varchar(191) NOT NULL,
|
|
|
|
`value` varchar(191) NOT NULL,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii DEFAULT NULL,
|
2021-05-14 13:21:23 +02:00
|
|
|
`meta_template_id` int(10) unsigned NOT NULL,
|
|
|
|
`meta_template_field_id` int(10) unsigned NOT NULL,
|
|
|
|
`is_default` tinyint(1) NOT NULL DEFAULT 0,
|
2020-09-28 01:25:07 +02:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `scope` (`scope`),
|
|
|
|
KEY `uuid` (`uuid`),
|
|
|
|
KEY `parent_id` (`parent_id`),
|
|
|
|
KEY `field` (`field`),
|
2021-05-14 13:21:23 +02:00
|
|
|
KEY `value` (`value`),
|
|
|
|
KEY `meta_template_id` (`meta_template_id`),
|
|
|
|
KEY `meta_template_field_id` (`meta_template_field_id`)
|
2020-09-28 01:25:07 +02:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `meta_templates` (
|
2020-09-28 01:25:07 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`scope` varchar(191) NOT NULL,
|
|
|
|
`name` varchar(191) NOT NULL,
|
|
|
|
`namespace` varchar(191) NOT NULL,
|
|
|
|
`description` text,
|
|
|
|
`version` varchar(191) NOT NULL,
|
|
|
|
`uuid` varchar(40) CHARACTER SET ascii,
|
|
|
|
`source` varchar(191),
|
|
|
|
`enabled` tinyint(1) DEFAULT 0,
|
2021-06-01 21:30:59 +02:00
|
|
|
`is_default` tinyint(1) NOT NULL DEFAULT 0,
|
2020-09-28 01:25:07 +02:00
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `scope` (`scope`),
|
|
|
|
KEY `source` (`source`),
|
|
|
|
KEY `name` (`name`),
|
|
|
|
KEY `namespace` (`namespace`),
|
|
|
|
KEY `version` (`version`),
|
|
|
|
KEY `uuid` (`uuid`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
2021-11-24 13:47:10 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `meta_template_fields` (
|
2020-09-28 01:25:07 +02:00
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`field` varchar(191) NOT NULL,
|
|
|
|
`type` varchar(191) NOT NULL,
|
|
|
|
`meta_template_id` int(10) unsigned NOT NULL,
|
|
|
|
`regex` text,
|
|
|
|
`multiple` tinyint(1) DEFAULT 0,
|
|
|
|
`enabled` tinyint(1) DEFAULT 0,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
CONSTRAINT `meta_template_id` FOREIGN KEY (`meta_template_id`) REFERENCES `meta_templates` (`id`),
|
|
|
|
KEY `field` (`field`),
|
|
|
|
KEY `type` (`type`)
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
2021-11-17 14:45:45 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS `audit_logs` (
|
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`created` datetime NOT NULL,
|
2021-11-17 15:40:44 +01:00
|
|
|
`user_id` int(10) unsigned DEFAULT NULL,
|
|
|
|
`authkey_id` int(10) unsigned DEFAULT NULL,
|
|
|
|
`request_ip` varbinary(16) DEFAULT NULL,
|
2021-11-17 14:45:45 +01:00
|
|
|
`request_type` tinyint NOT NULL,
|
|
|
|
`request_id` varchar(191) DEFAULT NULL,
|
2021-11-17 15:40:44 +01:00
|
|
|
`request_action` varchar(20) NOT NULL,
|
2021-11-17 14:45:45 +01:00
|
|
|
`model` varchar(80) NOT NULL,
|
2021-11-17 15:40:44 +01:00
|
|
|
`model_id` int(10) unsigned DEFAULT NULL,
|
2021-11-17 14:45:45 +01:00
|
|
|
`model_title` text DEFAULT NULL,
|
|
|
|
`change` blob,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY `user_id` (`user_id`),
|
2021-11-24 13:48:20 +01:00
|
|
|
KEY `request_ip` (`request_ip`),
|
2021-11-17 14:45:45 +01:00
|
|
|
KEY `model` (`model`),
|
2021-11-24 13:50:20 +01:00
|
|
|
KEY `request_action` (`request_action`),
|
2021-11-24 13:44:12 +01:00
|
|
|
KEY `model_id` (`model_id`),
|
2021-11-17 15:40:44 +01:00
|
|
|
KEY `created` (`created`)
|
2021-11-17 14:45:45 +01:00
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
2020-06-25 01:43:00 +02:00
|
|
|
|
2020-06-22 14:30:26 +02:00
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
|
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
|
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
|
|
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
|
|
|
|
-- Dump completed on 2020-06-22 14:30:02
|