Skip to content

Instantly share code, notes, and snippets.

@slaporte
Created December 27, 2019 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaporte/b817018d575561bb6297fdfc7d42742a to your computer and use it in GitHub Desktop.
Save slaporte/b817018d575561bb6297fdfc7d42742a to your computer and use it in GitHub Desktop.
-- MySQL dump 10.16 Distrib 10.1.41-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: tools-db Database: s53490__montage
-- ------------------------------------------------------
-- Server version 10.1.39-MariaDB
/*!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 `audit_log_entries`
--
DROP TABLE IF EXISTS `audit_log_entries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `audit_log_entries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`campaign_id` int(11) DEFAULT NULL,
`round_id` int(11) DEFAULT NULL,
`round_entry_id` int(11) DEFAULT NULL,
`role` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`action` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`message` text COLLATE utf8mb4_unicode_ci,
`flags` text COLLATE utf8mb4_unicode_ci,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `ix_audit_log_entries_round_id` (`round_id`),
KEY `ix_audit_log_entries_round_entry_id` (`round_entry_id`),
KEY `ix_audit_log_entries_create_date` (`create_date`),
KEY `ix_audit_log_entries_user_id` (`user_id`),
KEY `ix_audit_log_entries_campaign_id` (`campaign_id`),
CONSTRAINT `audit_log_entries_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `audit_log_entries_ibfk_2` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`),
CONSTRAINT `audit_log_entries_ibfk_3` FOREIGN KEY (`round_id`) REFERENCES `rounds` (`id`),
CONSTRAINT `audit_log_entries_ibfk_4` FOREIGN KEY (`round_entry_id`) REFERENCES `round_entries` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14179 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `campaign_coords`
--
DROP TABLE IF EXISTS `campaign_coords`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `campaign_coords` (
`user_id` int(11) NOT NULL,
`campaign_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`campaign_id`),
KEY `campaign_id` (`campaign_id`),
CONSTRAINT `campaign_coords_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `campaign_coords_ibfk_2` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `campaigns`
--
DROP TABLE IF EXISTS `campaigns`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `campaigns` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`series_id` int(11) DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`open_date` datetime DEFAULT NULL,
`close_date` datetime DEFAULT NULL,
`url` text COLLATE utf8mb4_unicode_ci,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_campaigns_series_id` (`series_id`),
KEY `ix_campaigns_name` (`name`(191)),
KEY `ix_campaigns_status` (`status`(191)),
CONSTRAINT `campaigns_ibfk_1` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=292 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `entries`
--
DROP TABLE IF EXISTS `entries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `entries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`mime_major` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`mime_minor` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`width` int(11) DEFAULT NULL,
`height` int(11) DEFAULT NULL,
`resolution` int(11) DEFAULT NULL,
`subject_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_user_id` int(11) DEFAULT NULL,
`upload_user_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upload_date` datetime DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_entries_upload_date` (`upload_date`)
) ENGINE=InnoDB AUTO_INCREMENT=573738 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `favorites`
--
DROP TABLE IF EXISTS `favorites`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `favorites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`entry_id` int(11) DEFAULT NULL,
`round_entry_id` int(11) DEFAULT NULL,
`campaign_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`modified_date` datetime DEFAULT NULL,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_favorites_round_entry_id` (`round_entry_id`),
KEY `ix_favorites_status` (`status`(191)),
KEY `ix_favorites_user_id` (`user_id`),
KEY `ix_favorites_entry_id` (`entry_id`),
KEY `ix_favorites_campaign_id` (`campaign_id`),
CONSTRAINT `favorites_ibfk_1` FOREIGN KEY (`entry_id`) REFERENCES `entries` (`id`),
CONSTRAINT `favorites_ibfk_2` FOREIGN KEY (`round_entry_id`) REFERENCES `round_entries` (`id`),
CONSTRAINT `favorites_ibfk_3` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`),
CONSTRAINT `favorites_ibfk_4` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `flags`
--
DROP TABLE IF EXISTS `flags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `flags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`round_entry_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`reason` text COLLATE utf8mb4_unicode_ci,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_flags_round_entry_id` (`round_entry_id`),
KEY `ix_flags_user_id` (`user_id`),
CONSTRAINT `flags_ibfk_1` FOREIGN KEY (`round_entry_id`) REFERENCES `round_entries` (`id`),
CONSTRAINT `flags_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `results_summaries`
--
DROP TABLE IF EXISTS `results_summaries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `results_summaries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`round_id` int(11) DEFAULT NULL,
`campaign_id` int(11) DEFAULT NULL,
`summary` text COLLATE utf8mb4_unicode_ci,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`language` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`version` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`modified_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_results_summaries_round_id` (`round_id`),
KEY `ix_results_summaries_status` (`status`(191)),
KEY `ix_results_summaries_campaign_id` (`campaign_id`),
CONSTRAINT `results_summaries_ibfk_1` FOREIGN KEY (`round_id`) REFERENCES `rounds` (`id`),
CONSTRAINT `results_summaries_ibfk_2` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `round_entries`
--
DROP TABLE IF EXISTS `round_entries`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `round_entries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`entry_id` int(11) DEFAULT NULL,
`round_id` int(11) DEFAULT NULL,
`round_source_id` int(11) DEFAULT NULL,
`dq_user_id` int(11) DEFAULT NULL,
`dq_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_round_entries_entry_id` (`entry_id`),
KEY `ix_round_entries_round_source_id` (`round_source_id`),
KEY `ix_round_entries_dq_user_id` (`dq_user_id`),
KEY `ix_round_entries_round_id` (`round_id`),
CONSTRAINT `round_entries_ibfk_1` FOREIGN KEY (`entry_id`) REFERENCES `entries` (`id`),
CONSTRAINT `round_entries_ibfk_2` FOREIGN KEY (`round_id`) REFERENCES `rounds` (`id`),
CONSTRAINT `round_entries_ibfk_3` FOREIGN KEY (`round_source_id`) REFERENCES `round_sources` (`id`),
CONSTRAINT `round_entries_ibfk_4` FOREIGN KEY (`dq_user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1184710 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `round_jurors`
--
DROP TABLE IF EXISTS `round_jurors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `round_jurors` (
`user_id` int(11) NOT NULL,
`round_id` int(11) NOT NULL,
`is_active` tinyint(1) DEFAULT NULL,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`user_id`,`round_id`),
KEY `round_id` (`round_id`),
CONSTRAINT `round_jurors_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `round_jurors_ibfk_2` FOREIGN KEY (`round_id`) REFERENCES `rounds` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `round_sources`
--
DROP TABLE IF EXISTS `round_sources`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `round_sources` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`round_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`params` text COLLATE utf8mb4_unicode_ci,
`dq_params` text COLLATE utf8mb4_unicode_ci,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_round_sources_round_id` (`round_id`),
KEY `ix_round_sources_method` (`method`(191)),
KEY `ix_round_sources_user_id` (`user_id`),
CONSTRAINT `round_sources_ibfk_1` FOREIGN KEY (`round_id`) REFERENCES `rounds` (`id`),
CONSTRAINT `round_sources_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=952 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `rounds`
--
DROP TABLE IF EXISTS `rounds`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rounds` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`directions` text COLLATE utf8mb4_unicode_ci,
`open_date` datetime DEFAULT NULL,
`close_date` datetime DEFAULT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`vote_method` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quorum` int(11) DEFAULT NULL,
`config` text COLLATE utf8mb4_unicode_ci,
`deadline_date` timestamp NULL DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
`campaign_id` int(11) DEFAULT NULL,
`campaign_seq` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_rounds_campaign_id` (`campaign_id`),
KEY `ix_rounds_name` (`name`(191)),
KEY `ix_rounds_status` (`status`(191)),
CONSTRAINT `rounds_ibfk_1` FOREIGN KEY (`campaign_id`) REFERENCES `campaigns` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1095 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `series`
--
DROP TABLE IF EXISTS `series`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `series` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`url` text COLLATE utf8mb4_unicode_ci,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_series_name` (`name`(191)),
KEY `ix_series_status` (`status`(191))
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_organizer` tinyint(1) DEFAULT NULL,
`last_active_date` datetime DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`flags` text COLLATE utf8mb4_unicode_ci,
`created_by` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `created_by` (`created_by`),
KEY `ix_users_username` (`username`(191)),
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=60773955 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `votes`
--
DROP TABLE IF EXISTS `votes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`round_entry_id` int(11) DEFAULT NULL,
`value` float DEFAULT NULL,
`status` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`modified_date` datetime DEFAULT NULL,
`flags` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `ix_votes_status` (`status`(191)),
KEY `ix_votes_user_id` (`user_id`),
KEY `ix_votes_round_entry_id` (`round_entry_id`),
CONSTRAINT `votes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `votes_ibfk_2` FOREIGN KEY (`round_entry_id`) REFERENCES `round_entries` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2474424 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!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 2019-12-27 3:25:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment