· 9 years ago · Nov 25, 2016, 04:16 PM
1-- MySQL dump 10.13 Distrib 5.5.53, for debian-linux-gnu (x86_64)
2--
3-- Host: localhost Database: ggrcdev
4-- ------------------------------------------------------
5-- Server version 5.5.53-0ubuntu0.14.04.1-log
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10/*!40101 SET NAMES utf8 */;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `access_groups`
20--
21
22DROP TABLE IF EXISTS `access_groups`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24/*!40101 SET character_set_client = utf8 */;
25CREATE TABLE `access_groups` (
26 `id` int(11) NOT NULL AUTO_INCREMENT,
27 `os_state` varchar(250) NOT NULL,
28 `end_date` date DEFAULT NULL,
29 `start_date` date DEFAULT NULL,
30 `status` varchar(250) DEFAULT NULL,
31 `notes` text,
32 `description` text,
33 `url` varchar(250) DEFAULT NULL,
34 `reference_url` varchar(250) DEFAULT NULL,
35 `secondary_contact_id` int(11) DEFAULT NULL,
36 `contact_id` int(11) DEFAULT NULL,
37 `title` varchar(250) NOT NULL,
38 `slug` varchar(250) NOT NULL,
39 `created_at` datetime NOT NULL,
40 `modified_by_id` int(11) DEFAULT NULL,
41 `updated_at` datetime NOT NULL,
42 `context_id` int(11) DEFAULT NULL,
43 PRIMARY KEY (`id`),
44 UNIQUE KEY `uq_access_groups` (`slug`),
45 UNIQUE KEY `uq_t_access_groups` (`title`),
46 KEY `fk_access_groups_contact` (`contact_id`),
47 KEY `fk_access_groups_contexts` (`context_id`),
48 KEY `fk_access_groups_secondary_contact` (`secondary_contact_id`),
49 KEY `ix_access_groups_updated_at` (`updated_at`),
50 CONSTRAINT `access_groups_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
51 CONSTRAINT `access_groups_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
52 CONSTRAINT `access_groups_ibfk_3` FOREIGN KEY (`secondary_contact_id`) REFERENCES `people` (`id`)
53) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54/*!40101 SET character_set_client = @saved_cs_client */;
55
56--
57-- Dumping data for table `access_groups`
58--
59
60LOCK TABLES `access_groups` WRITE;
61/*!40000 ALTER TABLE `access_groups` DISABLE KEYS */;
62/*!40000 ALTER TABLE `access_groups` ENABLE KEYS */;
63UNLOCK TABLES;
64
65--
66-- Table structure for table `assessment_templates`
67--
68
69DROP TABLE IF EXISTS `assessment_templates`;
70/*!40101 SET @saved_cs_client = @@character_set_client */;
71/*!40101 SET character_set_client = utf8 */;
72CREATE TABLE `assessment_templates` (
73 `id` int(11) NOT NULL AUTO_INCREMENT,
74 `template_object_type` varchar(250) DEFAULT NULL,
75 `test_plan_procedure` tinyint(1) NOT NULL DEFAULT '0',
76 `procedure_description` text,
77 `default_people` text NOT NULL,
78 `created_at` datetime NOT NULL,
79 `modified_by_id` int(11) DEFAULT NULL,
80 `updated_at` datetime NOT NULL,
81 `context_id` int(11) DEFAULT NULL,
82 `title` varchar(250) NOT NULL,
83 `slug` varchar(250) NOT NULL,
84 PRIMARY KEY (`id`),
85 KEY `context_id` (`context_id`),
86 CONSTRAINT `assessment_templates_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
87) ENGINE=InnoDB DEFAULT CHARSET=utf8;
88/*!40101 SET character_set_client = @saved_cs_client */;
89
90--
91-- Dumping data for table `assessment_templates`
92--
93
94LOCK TABLES `assessment_templates` WRITE;
95/*!40000 ALTER TABLE `assessment_templates` DISABLE KEYS */;
96/*!40000 ALTER TABLE `assessment_templates` ENABLE KEYS */;
97UNLOCK TABLES;
98
99--
100-- Table structure for table `assessments`
101--
102
103DROP TABLE IF EXISTS `assessments`;
104/*!40101 SET @saved_cs_client = @@character_set_client */;
105/*!40101 SET character_set_client = utf8 */;
106CREATE TABLE `assessments` (
107 `id` int(11) NOT NULL AUTO_INCREMENT,
108 `design` varchar(250) DEFAULT NULL,
109 `operationally` varchar(250) DEFAULT NULL,
110 `os_state` varchar(250) NOT NULL,
111 `test_plan` text,
112 `end_date` date DEFAULT NULL,
113 `start_date` date DEFAULT NULL,
114 `status` enum('Not Started','In Progress','Ready for Review','Verified','Completed') NOT NULL,
115 `notes` text,
116 `description` text,
117 `url` varchar(250) DEFAULT NULL,
118 `reference_url` varchar(250) DEFAULT NULL,
119 `secondary_contact_id` int(11) DEFAULT NULL,
120 `contact_id` int(11) DEFAULT NULL,
121 `title` varchar(250) NOT NULL,
122 `slug` varchar(250) NOT NULL,
123 `created_at` datetime NOT NULL,
124 `modified_by_id` int(11) DEFAULT NULL,
125 `updated_at` datetime NOT NULL,
126 `context_id` int(11) DEFAULT NULL,
127 `control_id` int(11) DEFAULT NULL,
128 `finished_date` datetime DEFAULT NULL,
129 `verified_date` datetime DEFAULT NULL,
130 `recipients` varchar(250) DEFAULT NULL,
131 `send_by_default` tinyint(1) DEFAULT NULL,
132 PRIMARY KEY (`id`),
133 UNIQUE KEY `uq_control_assessments` (`slug`),
134 KEY `contact_id` (`contact_id`),
135 KEY `context_id` (`context_id`),
136 KEY `secondary_contact_id` (`secondary_contact_id`),
137 KEY `fk_control_control_assessment` (`control_id`),
138 CONSTRAINT `assessments_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
139 CONSTRAINT `assessments_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
140 CONSTRAINT `assessments_ibfk_3` FOREIGN KEY (`secondary_contact_id`) REFERENCES `people` (`id`),
141 CONSTRAINT `fk_control_control_assessment` FOREIGN KEY (`control_id`) REFERENCES `controls` (`id`)
142) ENGINE=InnoDB DEFAULT CHARSET=utf8;
143/*!40101 SET character_set_client = @saved_cs_client */;
144
145--
146-- Dumping data for table `assessments`
147--
148
149LOCK TABLES `assessments` WRITE;
150/*!40000 ALTER TABLE `assessments` DISABLE KEYS */;
151/*!40000 ALTER TABLE `assessments` ENABLE KEYS */;
152UNLOCK TABLES;
153
154--
155-- Table structure for table `audit_objects`
156--
157
158DROP TABLE IF EXISTS `audit_objects`;
159/*!40101 SET @saved_cs_client = @@character_set_client */;
160/*!40101 SET character_set_client = utf8 */;
161CREATE TABLE `audit_objects` (
162 `id` int(11) NOT NULL AUTO_INCREMENT,
163 `modified_by_id` int(11) DEFAULT NULL,
164 `created_at` datetime NOT NULL,
165 `updated_at` datetime NOT NULL,
166 `context_id` int(11) NOT NULL,
167 `audit_id` int(11) NOT NULL,
168 `auditable_id` int(11) NOT NULL,
169 `auditable_type` varchar(250) NOT NULL,
170 PRIMARY KEY (`id`),
171 UNIQUE KEY `audit_id` (`audit_id`,`auditable_id`,`auditable_type`),
172 KEY `context_id` (`context_id`),
173 CONSTRAINT `audit_objects_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
174 CONSTRAINT `audit_objects_ibfk_2` FOREIGN KEY (`audit_id`) REFERENCES `audits` (`id`)
175) ENGINE=InnoDB DEFAULT CHARSET=utf8;
176/*!40101 SET character_set_client = @saved_cs_client */;
177
178--
179-- Dumping data for table `audit_objects`
180--
181
182LOCK TABLES `audit_objects` WRITE;
183/*!40000 ALTER TABLE `audit_objects` DISABLE KEYS */;
184/*!40000 ALTER TABLE `audit_objects` ENABLE KEYS */;
185UNLOCK TABLES;
186
187--
188-- Table structure for table `audits`
189--
190
191DROP TABLE IF EXISTS `audits`;
192/*!40101 SET @saved_cs_client = @@character_set_client */;
193/*!40101 SET character_set_client = utf8 */;
194CREATE TABLE `audits` (
195 `id` int(11) NOT NULL AUTO_INCREMENT,
196 `title` varchar(250) NOT NULL,
197 `slug` varchar(250) NOT NULL,
198 `description` text,
199 `url` varchar(250) DEFAULT NULL,
200 `start_date` date DEFAULT NULL,
201 `end_date` date DEFAULT NULL,
202 `report_start_date` date DEFAULT NULL,
203 `report_end_date` date DEFAULT NULL,
204 `contact_id` int(11) DEFAULT NULL,
205 `status` enum('Planned','In Progress','Manager Review','Ready for External Review','Completed') NOT NULL,
206 `gdrive_evidence_folder` varchar(250) DEFAULT NULL,
207 `program_id` int(11) NOT NULL,
208 `created_at` datetime NOT NULL,
209 `modified_by_id` int(11) DEFAULT NULL,
210 `updated_at` datetime NOT NULL,
211 `context_id` int(11) DEFAULT NULL,
212 `notes` text,
213 `audit_firm_id` int(11) DEFAULT NULL,
214 `reference_url` varchar(250) DEFAULT NULL,
215 `object_type` varchar(250) NOT NULL,
216 `secondary_contact_id` int(11) DEFAULT NULL,
217 PRIMARY KEY (`id`),
218 UNIQUE KEY `uq_t_audits` (`title`),
219 KEY `program_id` (`program_id`),
220 KEY `fk_audits_contact` (`contact_id`),
221 KEY `fk_audits_contexts` (`context_id`),
222 KEY `ix_audits_updated_at` (`updated_at`),
223 KEY `fk_audits_secondary_contact` (`secondary_contact_id`),
224 CONSTRAINT `audits_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
225 CONSTRAINT `audits_ibfk_3` FOREIGN KEY (`program_id`) REFERENCES `programs` (`id`)
226) ENGINE=InnoDB DEFAULT CHARSET=utf8;
227/*!40101 SET character_set_client = @saved_cs_client */;
228
229--
230-- Dumping data for table `audits`
231--
232
233LOCK TABLES `audits` WRITE;
234/*!40000 ALTER TABLE `audits` DISABLE KEYS */;
235/*!40000 ALTER TABLE `audits` ENABLE KEYS */;
236UNLOCK TABLES;
237
238--
239-- Table structure for table `background_tasks`
240--
241
242DROP TABLE IF EXISTS `background_tasks`;
243/*!40101 SET @saved_cs_client = @@character_set_client */;
244/*!40101 SET character_set_client = utf8 */;
245CREATE TABLE `background_tasks` (
246 `id` int(11) NOT NULL AUTO_INCREMENT,
247 `name` varchar(250) DEFAULT NULL,
248 `parameters` mediumblob,
249 `result` mediumblob,
250 `created_at` datetime NOT NULL,
251 `modified_by_id` int(11) DEFAULT NULL,
252 `updated_at` datetime NOT NULL,
253 `context_id` int(11) DEFAULT NULL,
254 `status` varchar(250) DEFAULT NULL,
255 PRIMARY KEY (`id`),
256 KEY `fk_background_tasks_contexts` (`context_id`),
257 KEY `ix_background_tasks_updated_at` (`updated_at`),
258 CONSTRAINT `background_tasks_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
259) ENGINE=InnoDB DEFAULT CHARSET=utf8;
260/*!40101 SET character_set_client = @saved_cs_client */;
261
262--
263-- Dumping data for table `background_tasks`
264--
265
266LOCK TABLES `background_tasks` WRITE;
267/*!40000 ALTER TABLE `background_tasks` DISABLE KEYS */;
268/*!40000 ALTER TABLE `background_tasks` ENABLE KEYS */;
269UNLOCK TABLES;
270
271--
272-- Table structure for table `categories`
273--
274
275DROP TABLE IF EXISTS `categories`;
276/*!40101 SET @saved_cs_client = @@character_set_client */;
277/*!40101 SET character_set_client = utf8 */;
278CREATE TABLE `categories` (
279 `id` int(11) NOT NULL AUTO_INCREMENT,
280 `modified_by_id` int(11) DEFAULT NULL,
281 `created_at` datetime NOT NULL,
282 `updated_at` datetime NOT NULL,
283 `name` varchar(250) DEFAULT NULL,
284 `lft` int(11) DEFAULT NULL,
285 `rgt` int(11) DEFAULT NULL,
286 `scope_id` int(11) DEFAULT NULL,
287 `depth` int(11) DEFAULT NULL,
288 `required` tinyint(1) DEFAULT NULL,
289 `parent_id` int(11) DEFAULT NULL,
290 `context_id` int(11) DEFAULT NULL,
291 `type` varchar(250) DEFAULT NULL,
292 PRIMARY KEY (`id`),
293 KEY `parent_id` (`parent_id`),
294 KEY `fk_categories_contexts` (`context_id`),
295 KEY `ix_categories_updated_at` (`updated_at`),
296 CONSTRAINT `fk_categories_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
297) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8;
298/*!40101 SET character_set_client = @saved_cs_client */;
299
300--
301-- Dumping data for table `categories`
302--
303
304LOCK TABLES `categories` WRITE;
305/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
306INSERT INTO `categories` VALUES (37,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Confidentiality',NULL,NULL,102,NULL,NULL,NULL,NULL,'ControlAssertion'),(38,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Integrity',NULL,NULL,102,NULL,NULL,NULL,NULL,'ControlAssertion'),(39,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Availability',NULL,NULL,102,NULL,NULL,NULL,NULL,'ControlAssertion'),(40,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Security',NULL,NULL,102,NULL,NULL,NULL,NULL,'ControlAssertion'),(41,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Privacy',NULL,NULL,102,NULL,NULL,NULL,NULL,'ControlAssertion'),(42,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Org and Admin/Governance',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(43,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Training',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(44,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Policies & Procedures',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(45,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','HR',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(46,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Logical Access/ Access Control',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(47,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Access Management',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(48,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Authorization',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(49,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Authentication',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(50,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Change Management',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(51,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Segregation of Duties',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(52,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Configuration Management',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(53,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Package Verification and Code release',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(54,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Incident Management',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(55,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Monitoring ',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(56,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Process',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(57,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Business Continuity',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(58,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Disaster Recovery',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(59,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Restoration Tests',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(60,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Backup Logs ',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(61,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Replication',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(62,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Data Protection and Retention',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(63,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Physical Security',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(64,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Data Centers',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory'),(65,NULL,'2016-05-03 10:37:03','2016-05-03 10:37:03','Sites',NULL,NULL,100,NULL,NULL,NULL,NULL,'ControlCategory');
307/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
308UNLOCK TABLES;
309
310--
311-- Table structure for table `categorizations`
312--
313
314DROP TABLE IF EXISTS `categorizations`;
315/*!40101 SET @saved_cs_client = @@character_set_client */;
316/*!40101 SET character_set_client = utf8 */;
317CREATE TABLE `categorizations` (
318 `id` int(11) NOT NULL AUTO_INCREMENT,
319 `modified_by_id` int(11) DEFAULT NULL,
320 `created_at` datetime NOT NULL,
321 `updated_at` datetime NOT NULL,
322 `category_id` int(11) NOT NULL,
323 `categorizable_id` int(11) DEFAULT NULL,
324 `categorizable_type` varchar(250) DEFAULT NULL,
325 `context_id` int(11) DEFAULT NULL,
326 `category_type` varchar(250) DEFAULT NULL,
327 PRIMARY KEY (`id`),
328 KEY `category_id` (`category_id`),
329 KEY `fk_categorizations_contexts` (`context_id`),
330 KEY `ix_categorizations_updated_at` (`updated_at`),
331 CONSTRAINT `categorizations_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
332 CONSTRAINT `fk_categorizations_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
333) ENGINE=InnoDB DEFAULT CHARSET=utf8;
334/*!40101 SET character_set_client = @saved_cs_client */;
335
336--
337-- Dumping data for table `categorizations`
338--
339
340LOCK TABLES `categorizations` WRITE;
341/*!40000 ALTER TABLE `categorizations` DISABLE KEYS */;
342/*!40000 ALTER TABLE `categorizations` ENABLE KEYS */;
343UNLOCK TABLES;
344
345--
346-- Table structure for table `clauses`
347--
348
349DROP TABLE IF EXISTS `clauses`;
350/*!40101 SET @saved_cs_client = @@character_set_client */;
351/*!40101 SET character_set_client = utf8 */;
352CREATE TABLE `clauses` (
353 `id` int(11) NOT NULL AUTO_INCREMENT,
354 `na` tinyint(1) NOT NULL,
355 `notes` text,
356 `os_state` varchar(250) NOT NULL,
357 `parent_id` int(11) DEFAULT NULL,
358 `description` text,
359 `url` varchar(250) DEFAULT NULL,
360 `reference_url` varchar(250) DEFAULT NULL,
361 `secondary_contact_id` int(11) DEFAULT NULL,
362 `contact_id` int(11) DEFAULT NULL,
363 `title` varchar(250) NOT NULL,
364 `slug` varchar(250) NOT NULL,
365 `created_at` datetime NOT NULL,
366 `modified_by_id` int(11) DEFAULT NULL,
367 `updated_at` datetime NOT NULL,
368 `context_id` int(11) DEFAULT NULL,
369 `status` varchar(250) DEFAULT NULL,
370 `end_date` date DEFAULT NULL,
371 `start_date` date DEFAULT NULL,
372 PRIMARY KEY (`id`),
373 UNIQUE KEY `uq_clauses` (`slug`),
374 UNIQUE KEY `uq_t_clauses` (`title`),
375 KEY `contact_id` (`contact_id`),
376 KEY `context_id` (`context_id`),
377 KEY `parent_id` (`parent_id`),
378 KEY `secondary_contact_id` (`secondary_contact_id`),
379 CONSTRAINT `clauses_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
380 CONSTRAINT `clauses_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
381 CONSTRAINT `clauses_ibfk_3` FOREIGN KEY (`parent_id`) REFERENCES `clauses` (`id`),
382 CONSTRAINT `clauses_ibfk_4` FOREIGN KEY (`secondary_contact_id`) REFERENCES `people` (`id`)
383) ENGINE=InnoDB DEFAULT CHARSET=utf8;
384/*!40101 SET character_set_client = @saved_cs_client */;
385
386--
387-- Dumping data for table `clauses`
388--
389
390LOCK TABLES `clauses` WRITE;
391/*!40000 ALTER TABLE `clauses` DISABLE KEYS */;
392/*!40000 ALTER TABLE `clauses` ENABLE KEYS */;
393UNLOCK TABLES;
394
395--
396-- Table structure for table `comments`
397--
398
399DROP TABLE IF EXISTS `comments`;
400/*!40101 SET @saved_cs_client = @@character_set_client */;
401/*!40101 SET character_set_client = utf8 */;
402CREATE TABLE `comments` (
403 `id` int(11) NOT NULL AUTO_INCREMENT,
404 `description` text,
405 `created_at` datetime NOT NULL,
406 `modified_by_id` int(11) DEFAULT NULL,
407 `updated_at` datetime NOT NULL,
408 `context_id` int(11) DEFAULT NULL,
409 `assignee_type` text,
410 `revision_id` int(11) DEFAULT NULL,
411 `custom_attribute_definition_id` int(11) DEFAULT NULL,
412 PRIMARY KEY (`id`),
413 KEY `context_id` (`context_id`),
414 KEY `fk_comments_revisions` (`revision_id`),
415 KEY `fk_comments_custom_attribute_definitions` (`custom_attribute_definition_id`),
416 CONSTRAINT `fk_comments_custom_attribute_definitions` FOREIGN KEY (`custom_attribute_definition_id`) REFERENCES `custom_attribute_definitions` (`id`) ON DELETE SET NULL,
417 CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
418 CONSTRAINT `fk_comments_revisions` FOREIGN KEY (`revision_id`) REFERENCES `revisions` (`id`) ON DELETE SET NULL
419) ENGINE=InnoDB DEFAULT CHARSET=utf8;
420/*!40101 SET character_set_client = @saved_cs_client */;
421
422--
423-- Dumping data for table `comments`
424--
425
426LOCK TABLES `comments` WRITE;
427/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
428/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
429UNLOCK TABLES;
430
431--
432-- Table structure for table `context_implications`
433--
434
435DROP TABLE IF EXISTS `context_implications`;
436/*!40101 SET @saved_cs_client = @@character_set_client */;
437/*!40101 SET character_set_client = utf8 */;
438CREATE TABLE `context_implications` (
439 `id` int(11) NOT NULL AUTO_INCREMENT,
440 `context_id` int(11) DEFAULT NULL,
441 `source_context_id` int(11) DEFAULT NULL,
442 `modified_by_id` int(11) DEFAULT NULL,
443 `created_at` datetime NOT NULL,
444 `updated_at` datetime NOT NULL,
445 `context_scope` varchar(128) DEFAULT NULL,
446 `source_context_scope` varchar(128) DEFAULT NULL,
447 PRIMARY KEY (`id`),
448 KEY `fk_context_implications_contexts` (`context_id`),
449 KEY `ix_context_implications_updated_at` (`updated_at`),
450 KEY `ix_context_implications_source_id` (`source_context_id`)
451) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
452/*!40101 SET character_set_client = @saved_cs_client */;
453
454--
455-- Dumping data for table `context_implications`
456--
457
458LOCK TABLES `context_implications` WRITE;
459/*!40000 ALTER TABLE `context_implications` DISABLE KEYS */;
460INSERT INTO `context_implications` VALUES (1,NULL,NULL,NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,NULL);
461/*!40000 ALTER TABLE `context_implications` ENABLE KEYS */;
462UNLOCK TABLES;
463
464--
465-- Table structure for table `contexts`
466--
467
468DROP TABLE IF EXISTS `contexts`;
469/*!40101 SET @saved_cs_client = @@character_set_client */;
470/*!40101 SET character_set_client = utf8 */;
471CREATE TABLE `contexts` (
472 `id` int(11) NOT NULL AUTO_INCREMENT,
473 `name` varchar(128) DEFAULT NULL,
474 `description` text,
475 `related_object_id` int(11) DEFAULT NULL,
476 `related_object_type` varchar(128) DEFAULT NULL,
477 `modified_by_id` int(11) DEFAULT NULL,
478 `created_at` datetime NOT NULL,
479 `updated_at` datetime NOT NULL,
480 `context_id` int(11) DEFAULT NULL,
481 PRIMARY KEY (`id`),
482 KEY `fk_contexts_contexts` (`context_id`),
483 KEY `ix_context_related_object` (`related_object_type`,`related_object_id`),
484 KEY `ix_contexts_updated_at` (`updated_at`)
485) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
486/*!40101 SET character_set_client = @saved_cs_client */;
487
488--
489-- Dumping data for table `contexts`
490--
491
492LOCK TABLES `contexts` WRITE;
493/*!40000 ALTER TABLE `contexts` DISABLE KEYS */;
494INSERT INTO `contexts` VALUES (0,'System Administration','Context for super-user permissions.',NULL,NULL,NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL),(1,'Administration','Context for Administrative resources.',NULL,NULL,0,'2016-11-25 15:50:20','2016-11-25 15:50:20',1);
495/*!40000 ALTER TABLE `contexts` ENABLE KEYS */;
496UNLOCK TABLES;
497
498--
499-- Table structure for table `controls`
500--
501
502DROP TABLE IF EXISTS `controls`;
503/*!40101 SET @saved_cs_client = @@character_set_client */;
504/*!40101 SET character_set_client = utf8 */;
505CREATE TABLE `controls` (
506 `id` int(11) NOT NULL AUTO_INCREMENT,
507 `modified_by_id` int(11) DEFAULT NULL,
508 `created_at` datetime NOT NULL,
509 `updated_at` datetime NOT NULL,
510 `description` text,
511 `url` varchar(250) DEFAULT NULL,
512 `start_date` date DEFAULT NULL,
513 `end_date` date DEFAULT NULL,
514 `slug` varchar(250) NOT NULL,
515 `title` varchar(250) NOT NULL,
516 `directive_id` int(11) DEFAULT NULL,
517 `kind_id` int(11) DEFAULT NULL,
518 `means_id` int(11) DEFAULT NULL,
519 `version` varchar(250) DEFAULT NULL,
520 `documentation_description` text,
521 `verify_frequency_id` int(11) DEFAULT NULL,
522 `fraud_related` tinyint(1) DEFAULT NULL,
523 `key_control` tinyint(1) DEFAULT NULL,
524 `active` tinyint(1) DEFAULT NULL,
525 `notes` text,
526 `parent_id` int(11) DEFAULT NULL,
527 `company_control` tinyint(1) DEFAULT NULL,
528 `context_id` int(11) DEFAULT NULL,
529 `contact_id` int(11) DEFAULT NULL,
530 `status` varchar(250) DEFAULT NULL,
531 `principal_assessor_id` int(11) DEFAULT NULL,
532 `secondary_assessor_id` int(11) DEFAULT NULL,
533 `reference_url` varchar(250) DEFAULT NULL,
534 `secondary_contact_id` int(11) DEFAULT NULL,
535 `os_state` varchar(16) NOT NULL,
536 `test_plan` text,
537 PRIMARY KEY (`id`),
538 UNIQUE KEY `uq_controls` (`slug`),
539 UNIQUE KEY `uq_t_controls` (`title`),
540 KEY `directive_id` (`directive_id`),
541 KEY `parent_id` (`parent_id`),
542 KEY `fk_controls_contexts` (`context_id`),
543 KEY `fk_controls_contact` (`contact_id`),
544 KEY `ix_controls_principal_assessor` (`principal_assessor_id`),
545 KEY `ix_controls_secondary_assessor` (`secondary_assessor_id`),
546 KEY `ix_controls_updated_at` (`updated_at`),
547 KEY `fk_controls_secondary_contact` (`secondary_contact_id`),
548 CONSTRAINT `controls_ibfk_1` FOREIGN KEY (`directive_id`) REFERENCES `directives` (`id`),
549 CONSTRAINT `controls_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `controls` (`id`),
550 CONSTRAINT `fk_controls_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
551) ENGINE=InnoDB DEFAULT CHARSET=utf8;
552/*!40101 SET character_set_client = @saved_cs_client */;
553
554--
555-- Dumping data for table `controls`
556--
557
558LOCK TABLES `controls` WRITE;
559/*!40000 ALTER TABLE `controls` DISABLE KEYS */;
560/*!40000 ALTER TABLE `controls` ENABLE KEYS */;
561UNLOCK TABLES;
562
563--
564-- Table structure for table `custom_attribute_definitions`
565--
566
567DROP TABLE IF EXISTS `custom_attribute_definitions`;
568/*!40101 SET @saved_cs_client = @@character_set_client */;
569/*!40101 SET character_set_client = utf8 */;
570CREATE TABLE `custom_attribute_definitions` (
571 `id` int(11) NOT NULL AUTO_INCREMENT,
572 `modified_by_id` int(11) DEFAULT NULL,
573 `context_id` int(11) DEFAULT NULL,
574 `created_at` datetime NOT NULL,
575 `updated_at` datetime NOT NULL,
576 `title` varchar(250) NOT NULL,
577 `helptext` varchar(250) DEFAULT NULL,
578 `placeholder` varchar(250) DEFAULT NULL,
579 `definition_type` varchar(250) NOT NULL,
580 `attribute_type` varchar(250) NOT NULL,
581 `multi_choice_options` text,
582 `mandatory` tinyint(1) DEFAULT NULL,
583 `definition_id` int(11) DEFAULT NULL,
584 `multi_choice_mandatory` text,
585 PRIMARY KEY (`id`),
586 UNIQUE KEY `uq_custom_attribute` (`definition_type`,`definition_id`,`title`),
587 KEY `ix_custom_attributes_title` (`title`)
588) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
589/*!40101 SET character_set_client = @saved_cs_client */;
590
591--
592-- Dumping data for table `custom_attribute_definitions`
593--
594
595LOCK TABLES `custom_attribute_definitions` WRITE;
596/*!40000 ALTER TABLE `custom_attribute_definitions` DISABLE KEYS */;
597INSERT INTO `custom_attribute_definitions` VALUES (1,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA dropdown',NULL,NULL,'facility','Dropdown','one,two,three,four,five',NULL,NULL,NULL),(2,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA text',NULL,NULL,'facility','Text',NULL,NULL,NULL,NULL),(3,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA date',NULL,NULL,'facility','Date',NULL,NULL,NULL,NULL),(4,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA dropdown',NULL,NULL,'control','Dropdown','one,two,three,four,five',NULL,NULL,NULL),(5,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA text',NULL,NULL,'control','Text',NULL,NULL,NULL,NULL),(6,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA date',NULL,NULL,'control','Date',NULL,NULL,NULL,NULL),(7,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA dropdown',NULL,NULL,'market','Dropdown','one,two,three,four,five',NULL,NULL,NULL),(8,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA text',NULL,NULL,'market','Text',NULL,NULL,NULL,NULL),(9,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA date',NULL,NULL,'market','Date',NULL,NULL,NULL,NULL),(10,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA dropdown',NULL,NULL,'section','Dropdown','one,two,three,four,five',NULL,NULL,NULL),(11,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA text',NULL,NULL,'section','Text',NULL,NULL,NULL,NULL),(12,NULL,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','CA date',NULL,NULL,'section','Date',NULL,NULL,NULL,NULL);
598/*!40000 ALTER TABLE `custom_attribute_definitions` ENABLE KEYS */;
599UNLOCK TABLES;
600
601--
602-- Table structure for table `custom_attribute_values`
603--
604
605DROP TABLE IF EXISTS `custom_attribute_values`;
606/*!40101 SET @saved_cs_client = @@character_set_client */;
607/*!40101 SET character_set_client = utf8 */;
608CREATE TABLE `custom_attribute_values` (
609 `id` int(11) NOT NULL AUTO_INCREMENT,
610 `modified_by_id` int(11) DEFAULT NULL,
611 `context_id` int(11) DEFAULT NULL,
612 `created_at` datetime NOT NULL,
613 `updated_at` datetime NOT NULL,
614 `custom_attribute_id` int(11) NOT NULL,
615 `attributable_id` int(11) DEFAULT NULL,
616 `attributable_type` varchar(250) DEFAULT NULL,
617 `attribute_value` text,
618 `attribute_object_id` int(11) DEFAULT NULL,
619 PRIMARY KEY (`id`),
620 UNIQUE KEY `uq_custom_attribute_value` (`custom_attribute_id`,`attributable_id`),
621 KEY `custom_attribute_values_ibfk_1` (`custom_attribute_id`),
622 KEY `ix_custom_attributes_attributable` (`attributable_id`,`attributable_type`),
623 CONSTRAINT `custom_attribute_values_ibfk_1` FOREIGN KEY (`custom_attribute_id`) REFERENCES `custom_attribute_definitions` (`id`) ON DELETE CASCADE
624) ENGINE=InnoDB DEFAULT CHARSET=utf8;
625/*!40101 SET character_set_client = @saved_cs_client */;
626
627--
628-- Dumping data for table `custom_attribute_values`
629--
630
631LOCK TABLES `custom_attribute_values` WRITE;
632/*!40000 ALTER TABLE `custom_attribute_values` DISABLE KEYS */;
633/*!40000 ALTER TABLE `custom_attribute_values` ENABLE KEYS */;
634UNLOCK TABLES;
635
636--
637-- Table structure for table `cycle_task_entries`
638--
639
640DROP TABLE IF EXISTS `cycle_task_entries`;
641/*!40101 SET @saved_cs_client = @@character_set_client */;
642/*!40101 SET character_set_client = utf8 */;
643CREATE TABLE `cycle_task_entries` (
644 `id` int(11) NOT NULL AUTO_INCREMENT,
645 `cycle_task_group_object_task_id` int(11) NOT NULL,
646 `description` text,
647 `created_at` datetime NOT NULL,
648 `modified_by_id` int(11) DEFAULT NULL,
649 `updated_at` datetime NOT NULL,
650 `context_id` int(11) DEFAULT NULL,
651 `cycle_id` int(11) NOT NULL,
652 `_is_declining_review` tinyint(1) DEFAULT NULL,
653 PRIMARY KEY (`id`),
654 KEY `fk_cycle_task_entries_contexts` (`context_id`),
655 KEY `ix_cycle_task_entries_updated_at` (`updated_at`),
656 KEY `cycle_task_entries_cycle` (`cycle_id`),
657 KEY `cycle_task_entries_ibfk_2` (`cycle_task_group_object_task_id`),
658 CONSTRAINT `cycle_task_entries_cycle` FOREIGN KEY (`cycle_id`) REFERENCES `cycles` (`id`) ON DELETE CASCADE,
659 CONSTRAINT `cycle_task_entries_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
660 CONSTRAINT `cycle_task_entries_ibfk_2` FOREIGN KEY (`cycle_task_group_object_task_id`) REFERENCES `cycle_task_group_object_tasks` (`id`) ON DELETE CASCADE
661) ENGINE=InnoDB DEFAULT CHARSET=utf8;
662/*!40101 SET character_set_client = @saved_cs_client */;
663
664--
665-- Dumping data for table `cycle_task_entries`
666--
667
668LOCK TABLES `cycle_task_entries` WRITE;
669/*!40000 ALTER TABLE `cycle_task_entries` DISABLE KEYS */;
670/*!40000 ALTER TABLE `cycle_task_entries` ENABLE KEYS */;
671UNLOCK TABLES;
672
673--
674-- Table structure for table `cycle_task_group_object_tasks`
675--
676
677DROP TABLE IF EXISTS `cycle_task_group_object_tasks`;
678/*!40101 SET @saved_cs_client = @@character_set_client */;
679/*!40101 SET character_set_client = utf8 */;
680CREATE TABLE `cycle_task_group_object_tasks` (
681 `id` int(11) NOT NULL AUTO_INCREMENT,
682 `cycle_task_group_object_id` int(11) DEFAULT NULL,
683 `task_group_task_id` int(11) DEFAULT NULL,
684 `contact_id` int(11) DEFAULT NULL,
685 `status` varchar(250) DEFAULT NULL,
686 `end_date` date DEFAULT NULL,
687 `start_date` date DEFAULT NULL,
688 `description` text,
689 `title` varchar(250) NOT NULL,
690 `created_at` datetime NOT NULL,
691 `modified_by_id` int(11) DEFAULT NULL,
692 `updated_at` datetime NOT NULL,
693 `context_id` int(11) DEFAULT NULL,
694 `sort_index` varchar(250) NOT NULL,
695 `cycle_id` int(11) NOT NULL,
696 `response_options` text NOT NULL,
697 `selected_response_options` text NOT NULL,
698 `task_type` varchar(250) NOT NULL,
699 `cycle_task_group_id` int(11) NOT NULL,
700 `secondary_contact_id` int(11) DEFAULT NULL,
701 `slug` varchar(250) NOT NULL,
702 `finished_date` datetime DEFAULT NULL,
703 `verified_date` datetime DEFAULT NULL,
704 PRIMARY KEY (`id`),
705 UNIQUE KEY `unique_slug` (`slug`),
706 KEY `cycle_task_group_object_id` (`cycle_task_group_object_id`),
707 KEY `task_group_task_id` (`task_group_task_id`),
708 KEY `fk_cycle_task_group_object_tasks_contact` (`contact_id`),
709 KEY `fk_cycle_task_group_object_tasks_contexts` (`context_id`),
710 KEY `ix_cycle_task_group_object_tasks_updated_at` (`updated_at`),
711 KEY `fk_cycle_task_group_object_tasks_secondary_contact` (`secondary_contact_id`),
712 KEY `cycle_task_group_object_tasks_cycle` (`cycle_id`),
713 KEY `cycle_task_group_id` (`cycle_task_group_id`),
714 CONSTRAINT `cycle_task_group_id` FOREIGN KEY (`cycle_task_group_id`) REFERENCES `cycle_task_groups` (`id`) ON DELETE CASCADE,
715 CONSTRAINT `cycle_task_group_object_tasks_cycle` FOREIGN KEY (`cycle_id`) REFERENCES `cycles` (`id`) ON DELETE CASCADE,
716 CONSTRAINT `cycle_task_group_object_tasks_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
717 CONSTRAINT `cycle_task_group_object_tasks_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
718 CONSTRAINT `cycle_task_group_object_tasks_ibfk_3` FOREIGN KEY (`cycle_task_group_object_id`) REFERENCES `cycle_task_group_objects` (`id`)
719) ENGINE=InnoDB DEFAULT CHARSET=utf8;
720/*!40101 SET character_set_client = @saved_cs_client */;
721
722--
723-- Dumping data for table `cycle_task_group_object_tasks`
724--
725
726LOCK TABLES `cycle_task_group_object_tasks` WRITE;
727/*!40000 ALTER TABLE `cycle_task_group_object_tasks` DISABLE KEYS */;
728/*!40000 ALTER TABLE `cycle_task_group_object_tasks` ENABLE KEYS */;
729UNLOCK TABLES;
730
731--
732-- Table structure for table `cycle_task_group_objects`
733--
734
735DROP TABLE IF EXISTS `cycle_task_group_objects`;
736/*!40101 SET @saved_cs_client = @@character_set_client */;
737/*!40101 SET character_set_client = utf8 */;
738CREATE TABLE `cycle_task_group_objects` (
739 `id` int(11) NOT NULL AUTO_INCREMENT,
740 `cycle_task_group_id` int(11) NOT NULL,
741 `task_group_object_id` int(11) NOT NULL,
742 `contact_id` int(11) DEFAULT NULL,
743 `status` varchar(250) DEFAULT NULL,
744 `end_date` date DEFAULT NULL,
745 `start_date` date DEFAULT NULL,
746 `description` text,
747 `title` varchar(250) NOT NULL,
748 `created_at` datetime NOT NULL,
749 `modified_by_id` int(11) DEFAULT NULL,
750 `updated_at` datetime NOT NULL,
751 `context_id` int(11) DEFAULT NULL,
752 `cycle_id` int(11) NOT NULL,
753 `object_id` int(11) NOT NULL,
754 `object_type` varchar(250) NOT NULL,
755 `next_due_date` date DEFAULT NULL,
756 `secondary_contact_id` int(11) DEFAULT NULL,
757 PRIMARY KEY (`id`),
758 KEY `task_group_object_id` (`task_group_object_id`),
759 KEY `fk_cycle_task_group_objects_contact` (`contact_id`),
760 KEY `fk_cycle_task_group_objects_contexts` (`context_id`),
761 KEY `ix_cycle_task_group_objects_updated_at` (`updated_at`),
762 KEY `fk_cycle_task_group_objects_secondary_contact` (`secondary_contact_id`),
763 KEY `cycle_task_group_objects_cycle` (`cycle_id`),
764 KEY `cycle_task_group_objects_ibfk_3` (`cycle_task_group_id`),
765 CONSTRAINT `cycle_task_group_objects_cycle` FOREIGN KEY (`cycle_id`) REFERENCES `cycles` (`id`) ON DELETE CASCADE,
766 CONSTRAINT `cycle_task_group_objects_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
767 CONSTRAINT `cycle_task_group_objects_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
768 CONSTRAINT `cycle_task_group_objects_ibfk_3` FOREIGN KEY (`cycle_task_group_id`) REFERENCES `cycle_task_groups` (`id`) ON DELETE CASCADE
769) ENGINE=InnoDB DEFAULT CHARSET=utf8;
770/*!40101 SET character_set_client = @saved_cs_client */;
771
772--
773-- Dumping data for table `cycle_task_group_objects`
774--
775
776LOCK TABLES `cycle_task_group_objects` WRITE;
777/*!40000 ALTER TABLE `cycle_task_group_objects` DISABLE KEYS */;
778/*!40000 ALTER TABLE `cycle_task_group_objects` ENABLE KEYS */;
779UNLOCK TABLES;
780
781--
782-- Table structure for table `cycle_task_groups`
783--
784
785DROP TABLE IF EXISTS `cycle_task_groups`;
786/*!40101 SET @saved_cs_client = @@character_set_client */;
787/*!40101 SET character_set_client = utf8 */;
788CREATE TABLE `cycle_task_groups` (
789 `id` int(11) NOT NULL AUTO_INCREMENT,
790 `cycle_id` int(11) NOT NULL,
791 `task_group_id` int(11) DEFAULT NULL,
792 `contact_id` int(11) DEFAULT NULL,
793 `status` varchar(250) DEFAULT NULL,
794 `end_date` date DEFAULT NULL,
795 `start_date` date DEFAULT NULL,
796 `description` text,
797 `title` varchar(250) NOT NULL,
798 `created_at` datetime NOT NULL,
799 `modified_by_id` int(11) DEFAULT NULL,
800 `updated_at` datetime NOT NULL,
801 `context_id` int(11) DEFAULT NULL,
802 `sort_index` varchar(250) NOT NULL,
803 `next_due_date` date DEFAULT NULL,
804 `secondary_contact_id` int(11) DEFAULT NULL,
805 `slug` varchar(250) NOT NULL,
806 PRIMARY KEY (`id`),
807 UNIQUE KEY `unique_slug` (`slug`),
808 KEY `task_group_id` (`task_group_id`),
809 KEY `fk_cycle_task_groups_contact` (`contact_id`),
810 KEY `fk_cycle_task_groups_contexts` (`context_id`),
811 KEY `ix_cycle_task_groups_updated_at` (`updated_at`),
812 KEY `fk_cycle_task_groups_secondary_contact` (`secondary_contact_id`),
813 KEY `cycle_task_groups_ibfk_3` (`cycle_id`),
814 CONSTRAINT `cycle_task_groups_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
815 CONSTRAINT `cycle_task_groups_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
816 CONSTRAINT `cycle_task_groups_ibfk_3` FOREIGN KEY (`cycle_id`) REFERENCES `cycles` (`id`) ON DELETE CASCADE
817) ENGINE=InnoDB DEFAULT CHARSET=utf8;
818/*!40101 SET character_set_client = @saved_cs_client */;
819
820--
821-- Dumping data for table `cycle_task_groups`
822--
823
824LOCK TABLES `cycle_task_groups` WRITE;
825/*!40000 ALTER TABLE `cycle_task_groups` DISABLE KEYS */;
826/*!40000 ALTER TABLE `cycle_task_groups` ENABLE KEYS */;
827UNLOCK TABLES;
828
829--
830-- Table structure for table `cycles`
831--
832
833DROP TABLE IF EXISTS `cycles`;
834/*!40101 SET @saved_cs_client = @@character_set_client */;
835/*!40101 SET character_set_client = utf8 */;
836CREATE TABLE `cycles` (
837 `id` int(11) NOT NULL AUTO_INCREMENT,
838 `workflow_id` int(11) NOT NULL,
839 `contact_id` int(11) DEFAULT NULL,
840 `status` varchar(250) DEFAULT NULL,
841 `end_date` date DEFAULT NULL,
842 `start_date` date DEFAULT NULL,
843 `description` text,
844 `title` varchar(250) NOT NULL,
845 `slug` varchar(250) NOT NULL,
846 `created_at` datetime NOT NULL,
847 `modified_by_id` int(11) DEFAULT NULL,
848 `updated_at` datetime NOT NULL,
849 `context_id` int(11) DEFAULT NULL,
850 `is_current` tinyint(1) NOT NULL,
851 `next_due_date` date DEFAULT NULL,
852 `secondary_contact_id` int(11) DEFAULT NULL,
853 PRIMARY KEY (`id`),
854 UNIQUE KEY `uq_cycles` (`slug`),
855 KEY `fk_cycles_contact` (`contact_id`),
856 KEY `fk_cycles_contexts` (`context_id`),
857 KEY `ix_cycles_updated_at` (`updated_at`),
858 KEY `fk_cycles_secondary_contact` (`secondary_contact_id`),
859 KEY `cycles_ibfk_3` (`workflow_id`),
860 CONSTRAINT `cycles_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
861 CONSTRAINT `cycles_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
862 CONSTRAINT `cycles_ibfk_3` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE
863) ENGINE=InnoDB DEFAULT CHARSET=utf8;
864/*!40101 SET character_set_client = @saved_cs_client */;
865
866--
867-- Dumping data for table `cycles`
868--
869
870LOCK TABLES `cycles` WRITE;
871/*!40000 ALTER TABLE `cycles` DISABLE KEYS */;
872/*!40000 ALTER TABLE `cycles` ENABLE KEYS */;
873UNLOCK TABLES;
874
875--
876-- Table structure for table `data_assets`
877--
878
879DROP TABLE IF EXISTS `data_assets`;
880/*!40101 SET @saved_cs_client = @@character_set_client */;
881/*!40101 SET character_set_client = utf8 */;
882CREATE TABLE `data_assets` (
883 `id` int(11) NOT NULL AUTO_INCREMENT,
884 `modified_by_id` int(11) DEFAULT NULL,
885 `created_at` datetime NOT NULL,
886 `updated_at` datetime NOT NULL,
887 `description` text,
888 `url` varchar(250) DEFAULT NULL,
889 `start_date` date DEFAULT NULL,
890 `end_date` date DEFAULT NULL,
891 `slug` varchar(250) NOT NULL,
892 `title` varchar(250) NOT NULL,
893 `context_id` int(11) DEFAULT NULL,
894 `contact_id` int(11) DEFAULT NULL,
895 `notes` text,
896 `status` varchar(250) DEFAULT NULL,
897 `reference_url` varchar(250) DEFAULT NULL,
898 `secondary_contact_id` int(11) DEFAULT NULL,
899 `os_state` varchar(16) NOT NULL,
900 PRIMARY KEY (`id`),
901 UNIQUE KEY `uq_data_assets` (`slug`),
902 UNIQUE KEY `uq_t_data_assets` (`title`),
903 KEY `fk_data_assets_contexts` (`context_id`),
904 KEY `fk_data_assets_contact` (`contact_id`),
905 KEY `ix_data_assets_updated_at` (`updated_at`),
906 KEY `fk_data_assets_secondary_contact` (`secondary_contact_id`),
907 CONSTRAINT `fk_data_assets_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
908) ENGINE=InnoDB DEFAULT CHARSET=utf8;
909/*!40101 SET character_set_client = @saved_cs_client */;
910
911--
912-- Dumping data for table `data_assets`
913--
914
915LOCK TABLES `data_assets` WRITE;
916/*!40000 ALTER TABLE `data_assets` DISABLE KEYS */;
917/*!40000 ALTER TABLE `data_assets` ENABLE KEYS */;
918UNLOCK TABLES;
919
920--
921-- Table structure for table `directives`
922--
923
924DROP TABLE IF EXISTS `directives`;
925/*!40101 SET @saved_cs_client = @@character_set_client */;
926/*!40101 SET character_set_client = utf8 */;
927CREATE TABLE `directives` (
928 `id` int(11) NOT NULL AUTO_INCREMENT,
929 `modified_by_id` int(11) DEFAULT NULL,
930 `created_at` datetime NOT NULL,
931 `updated_at` datetime NOT NULL,
932 `description` text,
933 `url` varchar(250) DEFAULT NULL,
934 `start_date` date DEFAULT NULL,
935 `end_date` date DEFAULT NULL,
936 `slug` varchar(250) NOT NULL,
937 `title` varchar(250) NOT NULL,
938 `version` varchar(250) DEFAULT NULL,
939 `organization` varchar(250) DEFAULT NULL,
940 `scope` text,
941 `kind_id` int(11) DEFAULT NULL,
942 `audit_start_date` datetime DEFAULT NULL,
943 `audit_frequency_id` int(11) DEFAULT NULL,
944 `audit_duration_id` int(11) DEFAULT NULL,
945 `kind` varchar(250) DEFAULT NULL,
946 `context_id` int(11) DEFAULT NULL,
947 `meta_kind` varchar(250) DEFAULT NULL,
948 `contact_id` int(11) DEFAULT NULL,
949 `notes` text,
950 `status` varchar(250) DEFAULT NULL,
951 `reference_url` varchar(250) DEFAULT NULL,
952 `secondary_contact_id` int(11) DEFAULT NULL,
953 `os_state` varchar(16) NOT NULL,
954 PRIMARY KEY (`id`),
955 UNIQUE KEY `uq_directives` (`slug`),
956 UNIQUE KEY `uq_t_directives` (`title`),
957 KEY `fk_directives_contexts` (`context_id`),
958 KEY `fk_directives_contact` (`contact_id`),
959 KEY `ix_directives_meta_kind` (`meta_kind`),
960 KEY `ix_directives_updated_at` (`updated_at`),
961 KEY `fk_directives_secondary_contact` (`secondary_contact_id`),
962 CONSTRAINT `fk_directives_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
963) ENGINE=InnoDB DEFAULT CHARSET=utf8;
964/*!40101 SET character_set_client = @saved_cs_client */;
965
966--
967-- Dumping data for table `directives`
968--
969
970LOCK TABLES `directives` WRITE;
971/*!40000 ALTER TABLE `directives` DISABLE KEYS */;
972/*!40000 ALTER TABLE `directives` ENABLE KEYS */;
973UNLOCK TABLES;
974
975--
976-- Table structure for table `documents`
977--
978
979DROP TABLE IF EXISTS `documents`;
980/*!40101 SET @saved_cs_client = @@character_set_client */;
981/*!40101 SET character_set_client = utf8 */;
982CREATE TABLE `documents` (
983 `id` int(11) NOT NULL AUTO_INCREMENT,
984 `modified_by_id` int(11) DEFAULT NULL,
985 `created_at` datetime NOT NULL,
986 `updated_at` datetime NOT NULL,
987 `title` varchar(250) DEFAULT NULL,
988 `link` varchar(250) DEFAULT NULL,
989 `description` text,
990 `kind_id` int(11) DEFAULT NULL,
991 `year_id` int(11) DEFAULT NULL,
992 `language_id` int(11) DEFAULT NULL,
993 `context_id` int(11) DEFAULT NULL,
994 PRIMARY KEY (`id`),
995 KEY `fk_documents_contexts` (`context_id`),
996 KEY `ix_documents_updated_at` (`updated_at`),
997 CONSTRAINT `fk_documents_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
998) ENGINE=InnoDB DEFAULT CHARSET=utf8;
999/*!40101 SET character_set_client = @saved_cs_client */;
1000
1001--
1002-- Dumping data for table `documents`
1003--
1004
1005LOCK TABLES `documents` WRITE;
1006/*!40000 ALTER TABLE `documents` DISABLE KEYS */;
1007/*!40000 ALTER TABLE `documents` ENABLE KEYS */;
1008UNLOCK TABLES;
1009
1010--
1011-- Table structure for table `events`
1012--
1013
1014DROP TABLE IF EXISTS `events`;
1015/*!40101 SET @saved_cs_client = @@character_set_client */;
1016/*!40101 SET character_set_client = utf8 */;
1017CREATE TABLE `events` (
1018 `id` int(11) NOT NULL AUTO_INCREMENT,
1019 `modified_by_id` int(11) DEFAULT NULL,
1020 `created_at` datetime NOT NULL,
1021 `action` enum('POST','PUT','DELETE','BULK','GET') NOT NULL,
1022 `resource_id` int(11) DEFAULT NULL,
1023 `resource_type` varchar(250) DEFAULT NULL,
1024 `context_id` int(11) DEFAULT NULL,
1025 `updated_at` datetime NOT NULL,
1026 PRIMARY KEY (`id`),
1027 KEY `events_modified_by` (`modified_by_id`),
1028 KEY `fk_events_contexts` (`context_id`),
1029 KEY `ix_events_updated_at` (`updated_at`),
1030 CONSTRAINT `events_modified_by` FOREIGN KEY (`modified_by_id`) REFERENCES `people` (`id`),
1031 CONSTRAINT `fk_events_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1032) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
1033/*!40101 SET character_set_client = @saved_cs_client */;
1034
1035--
1036-- Dumping data for table `events`
1037--
1038
1039LOCK TABLES `events` WRITE;
1040/*!40000 ALTER TABLE `events` DISABLE KEYS */;
1041INSERT INTO `events` VALUES (1,1,'2016-11-25 15:50:31','POST',1,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(2,1,'2016-11-25 15:50:31','POST',2,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(3,1,'2016-11-25 15:50:31','POST',3,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(4,1,'2016-11-25 15:50:31','POST',4,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(5,1,'2016-11-25 15:50:31','POST',5,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(6,1,'2016-11-25 15:50:31','POST',6,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(7,1,'2016-11-25 15:50:31','POST',7,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(8,1,'2016-11-25 15:50:31','POST',8,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(9,1,'2016-11-25 15:50:31','POST',9,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(10,1,'2016-11-25 15:50:31','POST',10,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(11,1,'2016-11-25 15:50:31','POST',11,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31'),(12,1,'2016-11-25 15:50:31','POST',12,'CustomAttributeDefinition',NULL,'2016-11-25 15:50:31');
1042/*!40000 ALTER TABLE `events` ENABLE KEYS */;
1043UNLOCK TABLES;
1044
1045--
1046-- Table structure for table `facilities`
1047--
1048
1049DROP TABLE IF EXISTS `facilities`;
1050/*!40101 SET @saved_cs_client = @@character_set_client */;
1051/*!40101 SET character_set_client = utf8 */;
1052CREATE TABLE `facilities` (
1053 `id` int(11) NOT NULL AUTO_INCREMENT,
1054 `modified_by_id` int(11) DEFAULT NULL,
1055 `created_at` datetime NOT NULL,
1056 `updated_at` datetime NOT NULL,
1057 `description` text,
1058 `url` varchar(250) DEFAULT NULL,
1059 `start_date` date DEFAULT NULL,
1060 `end_date` date DEFAULT NULL,
1061 `slug` varchar(250) NOT NULL,
1062 `title` varchar(250) NOT NULL,
1063 `context_id` int(11) DEFAULT NULL,
1064 `contact_id` int(11) DEFAULT NULL,
1065 `notes` text,
1066 `status` varchar(250) DEFAULT NULL,
1067 `reference_url` varchar(250) DEFAULT NULL,
1068 `secondary_contact_id` int(11) DEFAULT NULL,
1069 `os_state` varchar(16) NOT NULL,
1070 PRIMARY KEY (`id`),
1071 UNIQUE KEY `uq_facilities` (`slug`),
1072 UNIQUE KEY `uq_t_facilities` (`title`),
1073 KEY `fk_facilities_contexts` (`context_id`),
1074 KEY `fk_facilities_contact` (`contact_id`),
1075 KEY `ix_facilities_updated_at` (`updated_at`),
1076 KEY `fk_facilities_secondary_contact` (`secondary_contact_id`),
1077 CONSTRAINT `fk_facilities_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1078) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1079/*!40101 SET character_set_client = @saved_cs_client */;
1080
1081--
1082-- Dumping data for table `facilities`
1083--
1084
1085LOCK TABLES `facilities` WRITE;
1086/*!40000 ALTER TABLE `facilities` DISABLE KEYS */;
1087/*!40000 ALTER TABLE `facilities` ENABLE KEYS */;
1088UNLOCK TABLES;
1089
1090--
1091-- Table structure for table `fulltext_record_properties`
1092--
1093
1094DROP TABLE IF EXISTS `fulltext_record_properties`;
1095/*!40101 SET @saved_cs_client = @@character_set_client */;
1096/*!40101 SET character_set_client = utf8 */;
1097CREATE TABLE `fulltext_record_properties` (
1098 `key` int(11) NOT NULL AUTO_INCREMENT,
1099 `type` varchar(64) NOT NULL,
1100 `tags` varchar(250) DEFAULT NULL,
1101 `property` varchar(64) NOT NULL,
1102 `content` text,
1103 `context_id` int(11) DEFAULT NULL,
1104 PRIMARY KEY (`key`,`type`,`property`),
1105 KEY `ix_fulltext_record_properties_context_id` (`context_id`),
1106 KEY `ix_fulltext_record_properties_key` (`key`),
1107 KEY `ix_fulltext_record_properties_tags` (`tags`),
1108 KEY `ix_fulltext_record_properties_type` (`type`)
1109) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
1110/*!40101 SET character_set_client = @saved_cs_client */;
1111
1112--
1113-- Dumping data for table `fulltext_record_properties`
1114--
1115
1116LOCK TABLES `fulltext_record_properties` WRITE;
1117/*!40000 ALTER TABLE `fulltext_record_properties` DISABLE KEYS */;
1118INSERT INTO `fulltext_record_properties` VALUES (1,'CustomAttributeDefinition','','title','CA dropdown',NULL),(2,'CustomAttributeDefinition','','title','CA text',NULL),(3,'CustomAttributeDefinition','','title','CA date',NULL),(4,'CustomAttributeDefinition','','title','CA dropdown',NULL),(5,'CustomAttributeDefinition','','title','CA text',NULL),(6,'CustomAttributeDefinition','','title','CA date',NULL),(7,'CustomAttributeDefinition','','title','CA dropdown',NULL),(8,'CustomAttributeDefinition','','title','CA text',NULL),(9,'CustomAttributeDefinition','','title','CA date',NULL),(10,'CustomAttributeDefinition','','title','CA dropdown',NULL),(11,'CustomAttributeDefinition','','title','CA text',NULL),(12,'CustomAttributeDefinition','','title','CA date',NULL);
1119/*!40000 ALTER TABLE `fulltext_record_properties` ENABLE KEYS */;
1120UNLOCK TABLES;
1121
1122--
1123-- Table structure for table `ggrc_alembic_version`
1124--
1125
1126DROP TABLE IF EXISTS `ggrc_alembic_version`;
1127/*!40101 SET @saved_cs_client = @@character_set_client */;
1128/*!40101 SET character_set_client = utf8 */;
1129CREATE TABLE `ggrc_alembic_version` (
1130 `version_num` varchar(32) NOT NULL
1131) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1132/*!40101 SET character_set_client = @saved_cs_client */;
1133
1134--
1135-- Dumping data for table `ggrc_alembic_version`
1136--
1137
1138LOCK TABLES `ggrc_alembic_version` WRITE;
1139/*!40000 ALTER TABLE `ggrc_alembic_version` DISABLE KEYS */;
1140INSERT INTO `ggrc_alembic_version` VALUES ('2a5a39600741'),('2a5a39600741');
1141/*!40000 ALTER TABLE `ggrc_alembic_version` ENABLE KEYS */;
1142UNLOCK TABLES;
1143
1144--
1145-- Table structure for table `ggrc_basic_permissions_alembic_version`
1146--
1147
1148DROP TABLE IF EXISTS `ggrc_basic_permissions_alembic_version`;
1149/*!40101 SET @saved_cs_client = @@character_set_client */;
1150/*!40101 SET character_set_client = utf8 */;
1151CREATE TABLE `ggrc_basic_permissions_alembic_version` (
1152 `version_num` varchar(32) NOT NULL
1153) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1154/*!40101 SET character_set_client = @saved_cs_client */;
1155
1156--
1157-- Dumping data for table `ggrc_basic_permissions_alembic_version`
1158--
1159
1160LOCK TABLES `ggrc_basic_permissions_alembic_version` WRITE;
1161/*!40000 ALTER TABLE `ggrc_basic_permissions_alembic_version` DISABLE KEYS */;
1162INSERT INTO `ggrc_basic_permissions_alembic_version` VALUES ('4e105fc39b25');
1163/*!40000 ALTER TABLE `ggrc_basic_permissions_alembic_version` ENABLE KEYS */;
1164UNLOCK TABLES;
1165
1166--
1167-- Table structure for table `ggrc_gdrive_integration_alembic_version`
1168--
1169
1170DROP TABLE IF EXISTS `ggrc_gdrive_integration_alembic_version`;
1171/*!40101 SET @saved_cs_client = @@character_set_client */;
1172/*!40101 SET character_set_client = utf8 */;
1173CREATE TABLE `ggrc_gdrive_integration_alembic_version` (
1174 `version_num` varchar(32) NOT NULL
1175) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1176/*!40101 SET character_set_client = @saved_cs_client */;
1177
1178--
1179-- Dumping data for table `ggrc_gdrive_integration_alembic_version`
1180--
1181
1182LOCK TABLES `ggrc_gdrive_integration_alembic_version` WRITE;
1183/*!40000 ALTER TABLE `ggrc_gdrive_integration_alembic_version` DISABLE KEYS */;
1184INSERT INTO `ggrc_gdrive_integration_alembic_version` VALUES ('395186a2d8');
1185/*!40000 ALTER TABLE `ggrc_gdrive_integration_alembic_version` ENABLE KEYS */;
1186UNLOCK TABLES;
1187
1188--
1189-- Table structure for table `ggrc_risk_assessments_alembic_version`
1190--
1191
1192DROP TABLE IF EXISTS `ggrc_risk_assessments_alembic_version`;
1193/*!40101 SET @saved_cs_client = @@character_set_client */;
1194/*!40101 SET character_set_client = utf8 */;
1195CREATE TABLE `ggrc_risk_assessments_alembic_version` (
1196 `version_num` varchar(32) NOT NULL
1197) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1198/*!40101 SET character_set_client = @saved_cs_client */;
1199
1200--
1201-- Dumping data for table `ggrc_risk_assessments_alembic_version`
1202--
1203
1204LOCK TABLES `ggrc_risk_assessments_alembic_version` WRITE;
1205/*!40000 ALTER TABLE `ggrc_risk_assessments_alembic_version` DISABLE KEYS */;
1206INSERT INTO `ggrc_risk_assessments_alembic_version` VALUES ('4d4b04a5b9c6');
1207/*!40000 ALTER TABLE `ggrc_risk_assessments_alembic_version` ENABLE KEYS */;
1208UNLOCK TABLES;
1209
1210--
1211-- Table structure for table `ggrc_risks_alembic_version`
1212--
1213
1214DROP TABLE IF EXISTS `ggrc_risks_alembic_version`;
1215/*!40101 SET @saved_cs_client = @@character_set_client */;
1216/*!40101 SET character_set_client = utf8 */;
1217CREATE TABLE `ggrc_risks_alembic_version` (
1218 `version_num` varchar(32) NOT NULL
1219) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1220/*!40101 SET character_set_client = @saved_cs_client */;
1221
1222--
1223-- Dumping data for table `ggrc_risks_alembic_version`
1224--
1225
1226LOCK TABLES `ggrc_risks_alembic_version` WRITE;
1227/*!40000 ALTER TABLE `ggrc_risks_alembic_version` DISABLE KEYS */;
1228INSERT INTO `ggrc_risks_alembic_version` VALUES ('3d2acc8a4425');
1229/*!40000 ALTER TABLE `ggrc_risks_alembic_version` ENABLE KEYS */;
1230UNLOCK TABLES;
1231
1232--
1233-- Table structure for table `ggrc_workflows_alembic_version`
1234--
1235
1236DROP TABLE IF EXISTS `ggrc_workflows_alembic_version`;
1237/*!40101 SET @saved_cs_client = @@character_set_client */;
1238/*!40101 SET character_set_client = utf8 */;
1239CREATE TABLE `ggrc_workflows_alembic_version` (
1240 `version_num` varchar(32) NOT NULL
1241) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1242/*!40101 SET character_set_client = @saved_cs_client */;
1243
1244--
1245-- Dumping data for table `ggrc_workflows_alembic_version`
1246--
1247
1248LOCK TABLES `ggrc_workflows_alembic_version` WRITE;
1249/*!40000 ALTER TABLE `ggrc_workflows_alembic_version` DISABLE KEYS */;
1250INSERT INTO `ggrc_workflows_alembic_version` VALUES ('4cb78ab9a321');
1251/*!40000 ALTER TABLE `ggrc_workflows_alembic_version` ENABLE KEYS */;
1252UNLOCK TABLES;
1253
1254--
1255-- Table structure for table `helps`
1256--
1257
1258DROP TABLE IF EXISTS `helps`;
1259/*!40101 SET @saved_cs_client = @@character_set_client */;
1260/*!40101 SET character_set_client = utf8 */;
1261CREATE TABLE `helps` (
1262 `id` int(11) NOT NULL AUTO_INCREMENT,
1263 `modified_by_id` int(11) DEFAULT NULL,
1264 `created_at` datetime NOT NULL,
1265 `updated_at` datetime NOT NULL,
1266 `slug` varchar(250) NOT NULL,
1267 `title` varchar(250) NOT NULL,
1268 `content` text,
1269 `context_id` int(11) DEFAULT NULL,
1270 PRIMARY KEY (`id`),
1271 UNIQUE KEY `uq_helps` (`slug`),
1272 KEY `fk_helps_contexts` (`context_id`),
1273 KEY `ix_helps_updated_at` (`updated_at`),
1274 CONSTRAINT `fk_helps_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1275) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1276/*!40101 SET character_set_client = @saved_cs_client */;
1277
1278--
1279-- Dumping data for table `helps`
1280--
1281
1282LOCK TABLES `helps` WRITE;
1283/*!40000 ALTER TABLE `helps` DISABLE KEYS */;
1284/*!40000 ALTER TABLE `helps` ENABLE KEYS */;
1285UNLOCK TABLES;
1286
1287--
1288-- Table structure for table `issues`
1289--
1290
1291DROP TABLE IF EXISTS `issues`;
1292/*!40101 SET @saved_cs_client = @@character_set_client */;
1293/*!40101 SET character_set_client = utf8 */;
1294CREATE TABLE `issues` (
1295 `id` int(11) NOT NULL AUTO_INCREMENT,
1296 `os_state` varchar(250) NOT NULL,
1297 `test_plan` text,
1298 `end_date` date DEFAULT NULL,
1299 `start_date` date DEFAULT NULL,
1300 `status` varchar(250) DEFAULT NULL,
1301 `notes` text,
1302 `description` text,
1303 `url` varchar(250) DEFAULT NULL,
1304 `reference_url` varchar(250) DEFAULT NULL,
1305 `secondary_contact_id` int(11) DEFAULT NULL,
1306 `contact_id` int(11) DEFAULT NULL,
1307 `title` varchar(250) NOT NULL,
1308 `slug` varchar(250) NOT NULL,
1309 `created_at` datetime NOT NULL,
1310 `modified_by_id` int(11) DEFAULT NULL,
1311 `updated_at` datetime NOT NULL,
1312 `context_id` int(11) DEFAULT NULL,
1313 PRIMARY KEY (`id`),
1314 UNIQUE KEY `uq_issues` (`slug`),
1315 UNIQUE KEY `uq_t_issues` (`title`),
1316 KEY `contact_id` (`contact_id`),
1317 KEY `context_id` (`context_id`),
1318 KEY `secondary_contact_id` (`secondary_contact_id`),
1319 CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
1320 CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
1321 CONSTRAINT `issues_ibfk_3` FOREIGN KEY (`secondary_contact_id`) REFERENCES `people` (`id`)
1322) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1323/*!40101 SET character_set_client = @saved_cs_client */;
1324
1325--
1326-- Dumping data for table `issues`
1327--
1328
1329LOCK TABLES `issues` WRITE;
1330/*!40000 ALTER TABLE `issues` DISABLE KEYS */;
1331/*!40000 ALTER TABLE `issues` ENABLE KEYS */;
1332UNLOCK TABLES;
1333
1334--
1335-- Table structure for table `markets`
1336--
1337
1338DROP TABLE IF EXISTS `markets`;
1339/*!40101 SET @saved_cs_client = @@character_set_client */;
1340/*!40101 SET character_set_client = utf8 */;
1341CREATE TABLE `markets` (
1342 `id` int(11) NOT NULL AUTO_INCREMENT,
1343 `modified_by_id` int(11) DEFAULT NULL,
1344 `created_at` datetime NOT NULL,
1345 `updated_at` datetime NOT NULL,
1346 `description` text,
1347 `url` varchar(250) DEFAULT NULL,
1348 `start_date` date DEFAULT NULL,
1349 `end_date` date DEFAULT NULL,
1350 `slug` varchar(250) NOT NULL,
1351 `title` varchar(250) NOT NULL,
1352 `context_id` int(11) DEFAULT NULL,
1353 `contact_id` int(11) DEFAULT NULL,
1354 `notes` text,
1355 `status` varchar(250) DEFAULT NULL,
1356 `reference_url` varchar(250) DEFAULT NULL,
1357 `secondary_contact_id` int(11) DEFAULT NULL,
1358 `os_state` varchar(16) NOT NULL,
1359 PRIMARY KEY (`id`),
1360 UNIQUE KEY `uq_markets` (`slug`),
1361 UNIQUE KEY `uq_t_markets` (`title`),
1362 KEY `fk_markets_contexts` (`context_id`),
1363 KEY `fk_markets_contact` (`contact_id`),
1364 KEY `ix_markets_updated_at` (`updated_at`),
1365 KEY `fk_markets_secondary_contact` (`secondary_contact_id`),
1366 CONSTRAINT `fk_markets_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1367) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1368/*!40101 SET character_set_client = @saved_cs_client */;
1369
1370--
1371-- Dumping data for table `markets`
1372--
1373
1374LOCK TABLES `markets` WRITE;
1375/*!40000 ALTER TABLE `markets` DISABLE KEYS */;
1376/*!40000 ALTER TABLE `markets` ENABLE KEYS */;
1377UNLOCK TABLES;
1378
1379--
1380-- Table structure for table `meetings`
1381--
1382
1383DROP TABLE IF EXISTS `meetings`;
1384/*!40101 SET @saved_cs_client = @@character_set_client */;
1385/*!40101 SET character_set_client = utf8 */;
1386CREATE TABLE `meetings` (
1387 `id` int(11) NOT NULL AUTO_INCREMENT,
1388 `title` varchar(250) NOT NULL,
1389 `created_at` datetime NOT NULL,
1390 `modified_by_id` int(11) DEFAULT NULL,
1391 `updated_at` datetime NOT NULL,
1392 `context_id` int(11) DEFAULT NULL,
1393 `description` text,
1394 `start_at` datetime NOT NULL,
1395 `end_at` datetime NOT NULL,
1396 PRIMARY KEY (`id`),
1397 KEY `fk_meetings_contexts` (`context_id`),
1398 KEY `ix_meetings_updated_at` (`updated_at`),
1399 CONSTRAINT `meetings_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1400) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1401/*!40101 SET character_set_client = @saved_cs_client */;
1402
1403--
1404-- Dumping data for table `meetings`
1405--
1406
1407LOCK TABLES `meetings` WRITE;
1408/*!40000 ALTER TABLE `meetings` DISABLE KEYS */;
1409/*!40000 ALTER TABLE `meetings` ENABLE KEYS */;
1410UNLOCK TABLES;
1411
1412--
1413-- Table structure for table `notification_configs`
1414--
1415
1416DROP TABLE IF EXISTS `notification_configs`;
1417/*!40101 SET @saved_cs_client = @@character_set_client */;
1418/*!40101 SET character_set_client = utf8 */;
1419CREATE TABLE `notification_configs` (
1420 `id` int(11) NOT NULL AUTO_INCREMENT,
1421 `name` varchar(250) DEFAULT NULL,
1422 `created_at` datetime NOT NULL,
1423 `modified_by_id` int(11) DEFAULT NULL,
1424 `updated_at` datetime NOT NULL,
1425 `context_id` int(11) DEFAULT NULL,
1426 `enable_flag` tinyint(1) DEFAULT NULL,
1427 `notif_type` varchar(250) DEFAULT NULL,
1428 `person_id` int(11) NOT NULL,
1429 PRIMARY KEY (`id`),
1430 UNIQUE KEY `uq_notif_configs_person_id_notif_type` (`person_id`,`notif_type`),
1431 KEY `fk_notification_configs_contexts` (`context_id`),
1432 KEY `ix_notification_configs_updated_at` (`updated_at`),
1433 CONSTRAINT `notification_configs_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
1434 CONSTRAINT `notification_configs_ibfk_2` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`)
1435) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1436/*!40101 SET character_set_client = @saved_cs_client */;
1437
1438--
1439-- Dumping data for table `notification_configs`
1440--
1441
1442LOCK TABLES `notification_configs` WRITE;
1443/*!40000 ALTER TABLE `notification_configs` DISABLE KEYS */;
1444/*!40000 ALTER TABLE `notification_configs` ENABLE KEYS */;
1445UNLOCK TABLES;
1446
1447--
1448-- Table structure for table `notification_types`
1449--
1450
1451DROP TABLE IF EXISTS `notification_types`;
1452/*!40101 SET @saved_cs_client = @@character_set_client */;
1453/*!40101 SET character_set_client = utf8 */;
1454CREATE TABLE `notification_types` (
1455 `id` int(11) NOT NULL AUTO_INCREMENT,
1456 `name` varchar(250) NOT NULL,
1457 `description` varchar(250) DEFAULT NULL,
1458 `advance_notice` int(11) DEFAULT NULL,
1459 `template` varchar(250) NOT NULL,
1460 `instant` tinyint(1) NOT NULL,
1461 `created_at` datetime NOT NULL,
1462 `modified_by_id` int(11) DEFAULT NULL,
1463 `updated_at` datetime NOT NULL,
1464 `context_id` int(11) DEFAULT NULL,
1465 PRIMARY KEY (`id`),
1466 KEY `modified_by_id` (`modified_by_id`),
1467 CONSTRAINT `notification_types_ibfk_1` FOREIGN KEY (`modified_by_id`) REFERENCES `people` (`id`)
1468) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
1469/*!40101 SET character_set_client = @saved_cs_client */;
1470
1471--
1472-- Dumping data for table `notification_types`
1473--
1474
1475LOCK TABLES `notification_types` WRITE;
1476/*!40000 ALTER TABLE `notification_types` DISABLE KEYS */;
1477INSERT INTO `notification_types` VALUES (1,'request_open','Notify all assignees Requesters Assignees and Verifiers that a new request has been created.',0,'request_open',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(2,'request_declined','Notify Requester that a request has been declined.',0,'request_declined',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(3,'request_manual','Send a manual notification to the Requester.',0,'request_manual',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(4,'assessment_open','Send an open assessment notification to Assessors, Assignees and Verifiers.',0,'assessment_open',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(5,'assessment_declined','Notify Assessor that an assessment was declined.',0,'assessment_declined',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(6,'assessment_manual','Send a manual notification to the Requester.',0,'assessment_manual',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(7,'assessment_assessor_reminder','Notify all Assessors that they should take a look at the assessment.',0,'',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(8,'comment_created','Notify selected users that a comment has been created',0,'comment_created',0,'2016-11-25 15:50:20',NULL,'2016-11-25 15:50:20',NULL),(9,'cycle_created','Notify workflow members that a one time workflow has been started and send them their assigned tasks.',0,'cycle_created',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(10,'manual_cycle_created','Notify workflow members that a one time workflow has been started and send them their assigned tasks.',0,'manual_cycle_created',1,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(11,'cycle_task_due_in','Notify task assignee his task is due in X days',1,'cycle_task_due_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(12,'one_time_cycle_task_due_in','Notify task assignee his task is due in X days',1,'cycle_task_due_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(13,'weekly_cycle_task_due_in','Notify task assignee his task is due in X days',1,'cycle_task_due_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(14,'monthly_cycle_task_due_in','Notify task assignee his task is due in X days',1,'cycle_task_due_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(15,'quarterly_cycle_task_due_in','Notify task assignee his task is due in X days',1,'cycle_task_due_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(16,'annually_cycle_task_due_in','Notify task assignee his task is due in X days',1,'cycle_task_due_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(17,'cycle_task_due_today','Notify task assignee his task is due today',0,'cycle_task_due_today',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(18,'cycle_task_reassigned','Notify task assignee his task is due today',0,'cycle_task_due_today',1,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(19,'task_group_assignee_change','Email owners on task group assignee change.',0,'task_group_assignee_change',1,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(20,'cycle_task_declined','Notify task assignee his task is due today',0,'cycle_task_due_today',1,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(21,'all_cycle_tasks_completed','Notify workflow owner when all cycle tasks in one cycle have been completed and verified',1,'weekly_workflow_starts_in',1,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(22,'weekly_workflow_starts_in','Advanced notification for a recurring workflow.',1,'weekly_workflow_starts_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(23,'monthly_workflow_starts_in','Advanced notification for a recurring workflow.',3,'monthly_workflow_starts_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(24,'quarterly_workflow_starts_in','Advanced notification for a recurring workflow.',7,'quaterly_workflow_starts_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(25,'annually_workflow_starts_in','Advanced notification for a recurring workflow.',15,'annual_workflow_starts_in',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL),(26,'cycle_start_failed','Notify workflow owners that a cycle has failed tostart for a recurring workflow',0,'cycle_start_failed',0,'2016-11-25 15:50:23',NULL,'2016-11-25 15:50:23',NULL);
1478/*!40000 ALTER TABLE `notification_types` ENABLE KEYS */;
1479UNLOCK TABLES;
1480
1481--
1482-- Table structure for table `notifications`
1483--
1484
1485DROP TABLE IF EXISTS `notifications`;
1486/*!40101 SET @saved_cs_client = @@character_set_client */;
1487/*!40101 SET character_set_client = utf8 */;
1488CREATE TABLE `notifications` (
1489 `id` int(11) NOT NULL AUTO_INCREMENT,
1490 `object_id` int(11) NOT NULL,
1491 `object_type` varchar(250) NOT NULL,
1492 `notification_type_id` int(11) NOT NULL,
1493 `send_on` datetime NOT NULL,
1494 `sent_at` datetime DEFAULT NULL,
1495 `custom_message` text,
1496 `force_notifications` tinyint(1) NOT NULL,
1497 `created_at` datetime NOT NULL,
1498 `modified_by_id` int(11) DEFAULT NULL,
1499 `updated_at` datetime NOT NULL,
1500 `context_id` int(11) DEFAULT NULL,
1501 PRIMARY KEY (`id`),
1502 KEY `modified_by_id` (`modified_by_id`),
1503 KEY `fk_notification_type_id` (`notification_type_id`),
1504 CONSTRAINT `notifications_ibfk_2` FOREIGN KEY (`notification_type_id`) REFERENCES `notification_types` (`id`),
1505 CONSTRAINT `notifications_ibfk_3` FOREIGN KEY (`modified_by_id`) REFERENCES `people` (`id`)
1506) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1507/*!40101 SET character_set_client = @saved_cs_client */;
1508
1509--
1510-- Dumping data for table `notifications`
1511--
1512
1513LOCK TABLES `notifications` WRITE;
1514/*!40000 ALTER TABLE `notifications` DISABLE KEYS */;
1515/*!40000 ALTER TABLE `notifications` ENABLE KEYS */;
1516UNLOCK TABLES;
1517
1518--
1519-- Table structure for table `object_documents`
1520--
1521
1522DROP TABLE IF EXISTS `object_documents`;
1523/*!40101 SET @saved_cs_client = @@character_set_client */;
1524/*!40101 SET character_set_client = utf8 */;
1525CREATE TABLE `object_documents` (
1526 `id` int(11) NOT NULL AUTO_INCREMENT,
1527 `modified_by_id` int(11) DEFAULT NULL,
1528 `created_at` datetime NOT NULL,
1529 `updated_at` datetime NOT NULL,
1530 `start_date` date DEFAULT NULL,
1531 `end_date` date DEFAULT NULL,
1532 `role` varchar(250) DEFAULT NULL,
1533 `notes` text,
1534 `document_id` int(11) NOT NULL,
1535 `documentable_id` int(11) NOT NULL,
1536 `documentable_type` varchar(250) NOT NULL,
1537 `context_id` int(11) DEFAULT NULL,
1538 `status` varchar(250) DEFAULT NULL,
1539 PRIMARY KEY (`id`),
1540 UNIQUE KEY `uq_object_documents` (`document_id`,`documentable_id`,`documentable_type`),
1541 KEY `fk_object_documents_contexts` (`context_id`),
1542 KEY `ix_document_id` (`document_id`),
1543 KEY `ix_object_documents_updated_at` (`updated_at`),
1544 CONSTRAINT `fk_object_documents_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
1545 CONSTRAINT `object_documents_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`)
1546) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1547/*!40101 SET character_set_client = @saved_cs_client */;
1548
1549--
1550-- Dumping data for table `object_documents`
1551--
1552
1553LOCK TABLES `object_documents` WRITE;
1554/*!40000 ALTER TABLE `object_documents` DISABLE KEYS */;
1555/*!40000 ALTER TABLE `object_documents` ENABLE KEYS */;
1556UNLOCK TABLES;
1557
1558--
1559-- Table structure for table `object_events`
1560--
1561
1562DROP TABLE IF EXISTS `object_events`;
1563/*!40101 SET @saved_cs_client = @@character_set_client */;
1564/*!40101 SET character_set_client = utf8 */;
1565CREATE TABLE `object_events` (
1566 `id` int(11) NOT NULL AUTO_INCREMENT,
1567 `modified_by_id` int(11) DEFAULT NULL,
1568 `created_at` datetime NOT NULL,
1569 `updated_at` datetime NOT NULL,
1570 `context_id` int(11) DEFAULT NULL,
1571 `calendar_id` varchar(250) DEFAULT NULL,
1572 `event_id` varchar(250) NOT NULL,
1573 `eventable_id` int(11) NOT NULL,
1574 `eventable_type` varchar(250) NOT NULL,
1575 PRIMARY KEY (`id`),
1576 KEY `fk_object_events_contexts` (`context_id`),
1577 KEY `ix_object_events_updated_at` (`updated_at`)
1578) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1579/*!40101 SET character_set_client = @saved_cs_client */;
1580
1581--
1582-- Dumping data for table `object_events`
1583--
1584
1585LOCK TABLES `object_events` WRITE;
1586/*!40000 ALTER TABLE `object_events` DISABLE KEYS */;
1587/*!40000 ALTER TABLE `object_events` ENABLE KEYS */;
1588UNLOCK TABLES;
1589
1590--
1591-- Table structure for table `object_files`
1592--
1593
1594DROP TABLE IF EXISTS `object_files`;
1595/*!40101 SET @saved_cs_client = @@character_set_client */;
1596/*!40101 SET character_set_client = utf8 */;
1597CREATE TABLE `object_files` (
1598 `id` int(11) NOT NULL AUTO_INCREMENT,
1599 `modified_by_id` int(11) DEFAULT NULL,
1600 `created_at` datetime NOT NULL,
1601 `updated_at` datetime NOT NULL,
1602 `context_id` int(11) DEFAULT NULL,
1603 `parent_folder_id` varchar(250) DEFAULT NULL,
1604 `file_id` varchar(250) NOT NULL,
1605 `fileable_id` int(11) NOT NULL,
1606 `fileable_type` varchar(250) NOT NULL,
1607 PRIMARY KEY (`id`),
1608 KEY `fk_object_files_contexts` (`context_id`),
1609 KEY `ix_object_files_updated_at` (`updated_at`)
1610) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1611/*!40101 SET character_set_client = @saved_cs_client */;
1612
1613--
1614-- Dumping data for table `object_files`
1615--
1616
1617LOCK TABLES `object_files` WRITE;
1618/*!40000 ALTER TABLE `object_files` DISABLE KEYS */;
1619/*!40000 ALTER TABLE `object_files` ENABLE KEYS */;
1620UNLOCK TABLES;
1621
1622--
1623-- Table structure for table `object_folders`
1624--
1625
1626DROP TABLE IF EXISTS `object_folders`;
1627/*!40101 SET @saved_cs_client = @@character_set_client */;
1628/*!40101 SET character_set_client = utf8 */;
1629CREATE TABLE `object_folders` (
1630 `id` int(11) NOT NULL AUTO_INCREMENT,
1631 `modified_by_id` int(11) DEFAULT NULL,
1632 `created_at` datetime NOT NULL,
1633 `updated_at` datetime NOT NULL,
1634 `context_id` int(11) DEFAULT NULL,
1635 `parent_folder_id` varchar(250) DEFAULT NULL,
1636 `folder_id` varchar(250) NOT NULL,
1637 `folderable_id` int(11) NOT NULL,
1638 `folderable_type` varchar(250) NOT NULL,
1639 PRIMARY KEY (`id`),
1640 KEY `fk_object_folders_contexts` (`context_id`),
1641 KEY `ix_folderable_id_type` (`folderable_type`,`folderable_id`),
1642 KEY `ix_object_folders_updated_at` (`updated_at`)
1643) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1644/*!40101 SET character_set_client = @saved_cs_client */;
1645
1646--
1647-- Dumping data for table `object_folders`
1648--
1649
1650LOCK TABLES `object_folders` WRITE;
1651/*!40000 ALTER TABLE `object_folders` DISABLE KEYS */;
1652/*!40000 ALTER TABLE `object_folders` ENABLE KEYS */;
1653UNLOCK TABLES;
1654
1655--
1656-- Table structure for table `object_owners`
1657--
1658
1659DROP TABLE IF EXISTS `object_owners`;
1660/*!40101 SET @saved_cs_client = @@character_set_client */;
1661/*!40101 SET character_set_client = utf8 */;
1662CREATE TABLE `object_owners` (
1663 `id` int(11) NOT NULL AUTO_INCREMENT,
1664 `person_id` int(11) NOT NULL,
1665 `ownable_id` int(11) NOT NULL,
1666 `ownable_type` varchar(250) NOT NULL,
1667 `modified_by_id` int(11) DEFAULT NULL,
1668 `created_at` datetime NOT NULL,
1669 `updated_at` datetime NOT NULL,
1670 `context_id` int(11) DEFAULT NULL,
1671 `status` varchar(250) DEFAULT NULL,
1672 PRIMARY KEY (`id`),
1673 UNIQUE KEY `uq_id_owners` (`person_id`,`ownable_id`,`ownable_type`),
1674 KEY `fk_object_owners_contexts` (`context_id`),
1675 KEY `ix_object_owners_ownable` (`ownable_type`,`ownable_id`),
1676 KEY `ix_object_owners_updated_at` (`updated_at`),
1677 CONSTRAINT `object_owners_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`),
1678 CONSTRAINT `object_owners_ibfk_2` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1679) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1680/*!40101 SET character_set_client = @saved_cs_client */;
1681
1682--
1683-- Dumping data for table `object_owners`
1684--
1685
1686LOCK TABLES `object_owners` WRITE;
1687/*!40000 ALTER TABLE `object_owners` DISABLE KEYS */;
1688/*!40000 ALTER TABLE `object_owners` ENABLE KEYS */;
1689UNLOCK TABLES;
1690
1691--
1692-- Table structure for table `object_people`
1693--
1694
1695DROP TABLE IF EXISTS `object_people`;
1696/*!40101 SET @saved_cs_client = @@character_set_client */;
1697/*!40101 SET character_set_client = utf8 */;
1698CREATE TABLE `object_people` (
1699 `id` int(11) NOT NULL AUTO_INCREMENT,
1700 `modified_by_id` int(11) DEFAULT NULL,
1701 `created_at` datetime NOT NULL,
1702 `updated_at` datetime NOT NULL,
1703 `start_date` date DEFAULT NULL,
1704 `end_date` date DEFAULT NULL,
1705 `role` varchar(250) DEFAULT NULL,
1706 `notes` text,
1707 `person_id` int(11) NOT NULL,
1708 `personable_id` int(11) NOT NULL,
1709 `personable_type` varchar(250) NOT NULL,
1710 `context_id` int(11) DEFAULT NULL,
1711 `status` varchar(250) DEFAULT NULL,
1712 PRIMARY KEY (`id`),
1713 UNIQUE KEY `uq_object_people` (`person_id`,`personable_id`,`personable_type`),
1714 KEY `fk_object_people_contexts` (`context_id`),
1715 KEY `ix_person_id` (`person_id`),
1716 KEY `ix_object_people_updated_at` (`updated_at`),
1717 CONSTRAINT `fk_object_people_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
1718 CONSTRAINT `object_people_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`)
1719) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1720/*!40101 SET character_set_client = @saved_cs_client */;
1721
1722--
1723-- Dumping data for table `object_people`
1724--
1725
1726LOCK TABLES `object_people` WRITE;
1727/*!40000 ALTER TABLE `object_people` DISABLE KEYS */;
1728/*!40000 ALTER TABLE `object_people` ENABLE KEYS */;
1729UNLOCK TABLES;
1730
1731--
1732-- Table structure for table `objectives`
1733--
1734
1735DROP TABLE IF EXISTS `objectives`;
1736/*!40101 SET @saved_cs_client = @@character_set_client */;
1737/*!40101 SET character_set_client = utf8 */;
1738CREATE TABLE `objectives` (
1739 `id` int(11) NOT NULL AUTO_INCREMENT,
1740 `modified_by_id` int(11) DEFAULT NULL,
1741 `created_at` datetime NOT NULL,
1742 `updated_at` datetime NOT NULL,
1743 `description` text,
1744 `url` varchar(250) DEFAULT NULL,
1745 `slug` varchar(250) NOT NULL,
1746 `title` varchar(250) NOT NULL,
1747 `notes` text,
1748 `context_id` int(11) DEFAULT NULL,
1749 `contact_id` int(11) DEFAULT NULL,
1750 `status` varchar(250) DEFAULT NULL,
1751 `reference_url` varchar(250) DEFAULT NULL,
1752 `secondary_contact_id` int(11) DEFAULT NULL,
1753 `os_state` varchar(16) NOT NULL,
1754 PRIMARY KEY (`id`),
1755 UNIQUE KEY `uq_objectives` (`slug`),
1756 UNIQUE KEY `uq_t_objectives` (`title`),
1757 KEY `fk_objectives_contact` (`contact_id`),
1758 KEY `fk_objectives_contexts` (`context_id`),
1759 KEY `ix_objectives_updated_at` (`updated_at`),
1760 KEY `fk_objectives_secondary_contact` (`secondary_contact_id`),
1761 CONSTRAINT `objectives_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1762) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1763/*!40101 SET character_set_client = @saved_cs_client */;
1764
1765--
1766-- Dumping data for table `objectives`
1767--
1768
1769LOCK TABLES `objectives` WRITE;
1770/*!40000 ALTER TABLE `objectives` DISABLE KEYS */;
1771/*!40000 ALTER TABLE `objectives` ENABLE KEYS */;
1772UNLOCK TABLES;
1773
1774--
1775-- Table structure for table `options`
1776--
1777
1778DROP TABLE IF EXISTS `options`;
1779/*!40101 SET @saved_cs_client = @@character_set_client */;
1780/*!40101 SET character_set_client = utf8 */;
1781CREATE TABLE `options` (
1782 `id` int(11) NOT NULL AUTO_INCREMENT,
1783 `modified_by_id` int(11) DEFAULT NULL,
1784 `created_at` datetime NOT NULL,
1785 `updated_at` datetime NOT NULL,
1786 `description` text,
1787 `role` varchar(250) DEFAULT NULL,
1788 `title` varchar(250) DEFAULT NULL,
1789 `required` tinyint(1) DEFAULT NULL,
1790 `context_id` int(11) DEFAULT NULL,
1791 PRIMARY KEY (`id`),
1792 KEY `fk_options_contexts` (`context_id`),
1793 KEY `ix_options_role` (`role`),
1794 KEY `ix_options_updated_at` (`updated_at`),
1795 CONSTRAINT `fk_options_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1796) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8;
1797/*!40101 SET character_set_client = @saved_cs_client */;
1798
1799--
1800-- Dumping data for table `options`
1801--
1802
1803LOCK TABLES `options` WRITE;
1804/*!40000 ALTER TABLE `options` DISABLE KEYS */;
1805INSERT INTO `options` VALUES (1,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','Client List',NULL,NULL),(2,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','Employee List',NULL,NULL),(3,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','Ledger Accounts',NULL,NULL),(4,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','Patents',NULL,NULL),(5,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','Personal Identifiable Info',NULL,NULL),(6,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','Source Code',NULL,NULL),(7,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'asset_type','User Data',NULL,NULL),(8,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','1 Month',NULL,NULL),(9,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','1 Week',NULL,NULL),(10,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','1 Year',NULL,NULL),(11,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','2 Months',NULL,NULL),(12,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','2 Weeks',NULL,NULL),(13,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','3 Months',NULL,NULL),(14,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','4 Months',NULL,NULL),(15,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_duration','6 Months',NULL,NULL),(16,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Ad-Hoc',NULL,NULL),(17,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Annual',NULL,NULL),(18,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Bi-Annual',NULL,NULL),(19,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Continuous',NULL,NULL),(20,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Daily',NULL,NULL),(21,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Hourly',NULL,NULL),(22,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Monthly',NULL,NULL),(23,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Quarterly',NULL,NULL),(24,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Semi-Annual',NULL,NULL),(25,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'audit_frequency','Weekly',NULL,NULL),(27,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'control_kind','Detective',NULL,NULL),(28,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'control_kind','Preventative',NULL,NULL),(38,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'directive_kind','Company Policy',NULL,NULL),(39,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'directive_kind','Data Asset Policy',NULL,NULL),(40,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'directive_kind','Operational Group Policy',NULL,NULL),(41,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'directive_kind','Regulation',NULL,NULL),(42,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_status','active',NULL,NULL),(43,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_status','deprecated',NULL,NULL),(44,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_type','Excel',NULL,NULL),(45,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_type','PDF',NULL,NULL),(46,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_type','Text',NULL,NULL),(47,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_type','URL',NULL,NULL),(48,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_type','Word',NULL,NULL),(49,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1980',NULL,NULL),(50,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1981',NULL,NULL),(51,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1982',NULL,NULL),(52,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1983',NULL,NULL),(53,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1984',NULL,NULL),(54,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1985',NULL,NULL),(55,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1986',NULL,NULL),(56,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1987',NULL,NULL),(57,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1988',NULL,NULL),(58,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1989',NULL,NULL),(59,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1990',NULL,NULL),(60,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1991',NULL,NULL),(61,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1992',NULL,NULL),(62,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1993',NULL,NULL),(63,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1994',NULL,NULL),(64,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1995',NULL,NULL),(65,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1996',NULL,NULL),(66,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1997',NULL,NULL),(67,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1998',NULL,NULL),(68,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','1999',NULL,NULL),(69,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2000',NULL,NULL),(70,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2001',NULL,NULL),(71,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2002',NULL,NULL),(72,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2003',NULL,NULL),(73,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2004',NULL,NULL),(74,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2005',NULL,NULL),(75,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2006',NULL,NULL),(76,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2007',NULL,NULL),(77,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2008',NULL,NULL),(78,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2009',NULL,NULL),(79,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2010',NULL,NULL),(80,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2011',NULL,NULL),(81,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2012',NULL,NULL),(82,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'document_year','2013',0,NULL),(83,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'entity_kind','Not Applicable',NULL,NULL),(84,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'entity_type','Business Unit',NULL,NULL),(85,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'entity_type','Division',NULL,NULL),(86,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'entity_type','Functional Group',NULL,NULL),(87,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'entity_type','Legal Entity',NULL,NULL),(88,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'language','English',NULL,NULL),(89,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Building',NULL,NULL),(90,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','HazMat Storage',NULL,NULL),(91,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Kitchen',NULL,NULL),(92,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Lab',NULL,NULL),(93,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Machine Room',NULL,NULL),(94,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Maintenance Facility',NULL,NULL),(95,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Office',NULL,NULL),(96,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Parking Garage',NULL,NULL),(97,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_kind','Workshop',NULL,NULL),(98,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Colo Data Center',NULL,NULL),(99,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Contract Manufacturer',NULL,NULL),(100,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Data Center',NULL,NULL),(101,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Distribution Center',NULL,NULL),(102,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Headquarters',NULL,NULL),(103,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Regional Office',NULL,NULL),(104,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Sales Office',NULL,NULL),(105,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'location_type','Vendor Worksite',NULL,NULL),(106,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'network_zone','Corp',0,NULL),(107,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'network_zone','Prod',0,NULL),(108,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'person_language','English',NULL,NULL),(109,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'product_kind','Not Applicable',NULL,NULL),(110,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'product_type','Appliance',NULL,NULL),(111,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'product_type','Desktop Software',NULL,NULL),(112,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'product_type','SaaS',NULL,NULL),(113,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'reference_type','Database',NULL,NULL),(114,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'reference_type','Document',NULL,NULL),(115,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'reference_type','Numeric Data',NULL,NULL),(116,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'reference_type','Screenshot',NULL,NULL),(117,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'reference_type','Simple Text',NULL,NULL),(118,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'reference_type','Website',NULL,NULL),(119,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'system_kind','Infrastructure',NULL,NULL),(120,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'system_type','Infrastructure',NULL,NULL),(121,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'threat_type','Insider Threat',NULL,NULL),(122,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'threat_type','Outsider Threat',NULL,NULL),(123,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Bi-Weekly',NULL,NULL),(124,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Yearly',NULL,NULL),(125,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Bi-Monthly',NULL,NULL),(126,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Continuous',NULL,NULL),(127,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Daily',NULL,NULL),(128,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Hourly',NULL,NULL),(129,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Indeterminate',0,NULL),(130,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Monthly',NULL,NULL),(131,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Quarterly',NULL,NULL),(132,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Semi-Annually',NULL,NULL),(133,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Transactional',0,NULL),(134,NULL,'2016-05-03 10:37:02','2016-05-03 10:37:02',NULL,'verify_frequency','Weekly',NULL,NULL),(135,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'network_zone','3rd Party',NULL,NULL),(136,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'network_zone','Core',NULL,NULL),(137,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'network_zone','Service',NULL,NULL),(138,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'control_kind','Corrective',NULL,NULL),(139,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'control_means','Technical',NULL,NULL),(140,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'control_means','Administrative',NULL,NULL),(141,NULL,'2016-11-25 15:50:20','2016-11-25 15:50:20',NULL,'control_means','Physical',NULL,NULL);
1806/*!40000 ALTER TABLE `options` ENABLE KEYS */;
1807UNLOCK TABLES;
1808
1809--
1810-- Table structure for table `org_groups`
1811--
1812
1813DROP TABLE IF EXISTS `org_groups`;
1814/*!40101 SET @saved_cs_client = @@character_set_client */;
1815/*!40101 SET character_set_client = utf8 */;
1816CREATE TABLE `org_groups` (
1817 `id` int(11) NOT NULL AUTO_INCREMENT,
1818 `modified_by_id` int(11) DEFAULT NULL,
1819 `created_at` datetime NOT NULL,
1820 `updated_at` datetime NOT NULL,
1821 `description` text,
1822 `url` varchar(250) DEFAULT NULL,
1823 `start_date` date DEFAULT NULL,
1824 `end_date` date DEFAULT NULL,
1825 `slug` varchar(250) NOT NULL,
1826 `title` varchar(250) NOT NULL,
1827 `context_id` int(11) DEFAULT NULL,
1828 `contact_id` int(11) DEFAULT NULL,
1829 `notes` text,
1830 `status` varchar(250) DEFAULT NULL,
1831 `reference_url` varchar(250) DEFAULT NULL,
1832 `secondary_contact_id` int(11) DEFAULT NULL,
1833 `os_state` varchar(16) NOT NULL,
1834 PRIMARY KEY (`id`),
1835 UNIQUE KEY `uq_org_groups` (`slug`),
1836 UNIQUE KEY `uq_t_org_groups` (`title`),
1837 KEY `fk_org_groups_contexts` (`context_id`),
1838 KEY `fk_org_groups_contact` (`contact_id`),
1839 KEY `ix_org_groups_updated_at` (`updated_at`),
1840 KEY `fk_org_groups_secondary_contact` (`secondary_contact_id`),
1841 CONSTRAINT `fk_org_groups_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1842) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1843/*!40101 SET character_set_client = @saved_cs_client */;
1844
1845--
1846-- Dumping data for table `org_groups`
1847--
1848
1849LOCK TABLES `org_groups` WRITE;
1850/*!40000 ALTER TABLE `org_groups` DISABLE KEYS */;
1851/*!40000 ALTER TABLE `org_groups` ENABLE KEYS */;
1852UNLOCK TABLES;
1853
1854--
1855-- Table structure for table `people`
1856--
1857
1858DROP TABLE IF EXISTS `people`;
1859/*!40101 SET @saved_cs_client = @@character_set_client */;
1860/*!40101 SET character_set_client = utf8 */;
1861CREATE TABLE `people` (
1862 `id` int(11) NOT NULL AUTO_INCREMENT,
1863 `modified_by_id` int(11) DEFAULT NULL,
1864 `created_at` datetime NOT NULL,
1865 `updated_at` datetime NOT NULL,
1866 `email` varchar(250) NOT NULL,
1867 `name` varchar(250) DEFAULT NULL,
1868 `language_id` int(11) DEFAULT NULL,
1869 `company` varchar(250) DEFAULT NULL,
1870 `context_id` int(11) DEFAULT NULL,
1871 PRIMARY KEY (`id`),
1872 UNIQUE KEY `uq_people_email` (`email`),
1873 KEY `fk_people_contexts` (`context_id`),
1874 KEY `ix_people_name_email` (`name`,`email`),
1875 KEY `ix_people_updated_at` (`updated_at`),
1876 CONSTRAINT `fk_people_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1877) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
1878/*!40101 SET character_set_client = @saved_cs_client */;
1879
1880--
1881-- Dumping data for table `people`
1882--
1883
1884LOCK TABLES `people` WRITE;
1885/*!40000 ALTER TABLE `people` DISABLE KEYS */;
1886INSERT INTO `people` VALUES (1,NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31','user@example.com','Example User',NULL,NULL,NULL);
1887/*!40000 ALTER TABLE `people` ENABLE KEYS */;
1888UNLOCK TABLES;
1889
1890--
1891-- Table structure for table `products`
1892--
1893
1894DROP TABLE IF EXISTS `products`;
1895/*!40101 SET @saved_cs_client = @@character_set_client */;
1896/*!40101 SET character_set_client = utf8 */;
1897CREATE TABLE `products` (
1898 `id` int(11) NOT NULL AUTO_INCREMENT,
1899 `modified_by_id` int(11) DEFAULT NULL,
1900 `created_at` datetime NOT NULL,
1901 `updated_at` datetime NOT NULL,
1902 `description` text,
1903 `url` varchar(250) DEFAULT NULL,
1904 `start_date` date DEFAULT NULL,
1905 `end_date` date DEFAULT NULL,
1906 `slug` varchar(250) NOT NULL,
1907 `title` varchar(250) NOT NULL,
1908 `kind_id` int(11) DEFAULT NULL,
1909 `version` varchar(250) DEFAULT NULL,
1910 `context_id` int(11) DEFAULT NULL,
1911 `contact_id` int(11) DEFAULT NULL,
1912 `notes` text,
1913 `status` varchar(250) DEFAULT NULL,
1914 `reference_url` varchar(250) DEFAULT NULL,
1915 `secondary_contact_id` int(11) DEFAULT NULL,
1916 `os_state` varchar(16) NOT NULL,
1917 PRIMARY KEY (`id`),
1918 UNIQUE KEY `uq_products` (`slug`),
1919 UNIQUE KEY `uq_t_products` (`title`),
1920 KEY `fk_products_contexts` (`context_id`),
1921 KEY `fk_products_contact` (`contact_id`),
1922 KEY `ix_products_updated_at` (`updated_at`),
1923 KEY `fk_products_secondary_contact` (`secondary_contact_id`),
1924 CONSTRAINT `fk_products_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1925) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1926/*!40101 SET character_set_client = @saved_cs_client */;
1927
1928--
1929-- Dumping data for table `products`
1930--
1931
1932LOCK TABLES `products` WRITE;
1933/*!40000 ALTER TABLE `products` DISABLE KEYS */;
1934/*!40000 ALTER TABLE `products` ENABLE KEYS */;
1935UNLOCK TABLES;
1936
1937--
1938-- Table structure for table `programs`
1939--
1940
1941DROP TABLE IF EXISTS `programs`;
1942/*!40101 SET @saved_cs_client = @@character_set_client */;
1943/*!40101 SET character_set_client = utf8 */;
1944CREATE TABLE `programs` (
1945 `id` int(11) NOT NULL AUTO_INCREMENT,
1946 `modified_by_id` int(11) DEFAULT NULL,
1947 `created_at` datetime NOT NULL,
1948 `updated_at` datetime NOT NULL,
1949 `description` text,
1950 `url` varchar(250) DEFAULT NULL,
1951 `start_date` date DEFAULT NULL,
1952 `end_date` date DEFAULT NULL,
1953 `slug` varchar(250) NOT NULL,
1954 `title` varchar(250) NOT NULL,
1955 `kind` varchar(250) DEFAULT NULL,
1956 `context_id` int(11) DEFAULT NULL,
1957 `contact_id` int(11) DEFAULT NULL,
1958 `notes` text,
1959 `status` varchar(250) DEFAULT NULL,
1960 `reference_url` varchar(250) DEFAULT NULL,
1961 `secondary_contact_id` int(11) DEFAULT NULL,
1962 `os_state` varchar(16) NOT NULL,
1963 PRIMARY KEY (`id`),
1964 UNIQUE KEY `uq_programs` (`slug`),
1965 UNIQUE KEY `uq_t_programs` (`title`),
1966 KEY `fk_programs_contexts` (`context_id`),
1967 KEY `fk_programs_contact` (`contact_id`),
1968 KEY `ix_programs_updated_at` (`updated_at`),
1969 KEY `fk_programs_secondary_contact` (`secondary_contact_id`),
1970 CONSTRAINT `fk_programs_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
1971) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1972/*!40101 SET character_set_client = @saved_cs_client */;
1973
1974--
1975-- Dumping data for table `programs`
1976--
1977
1978LOCK TABLES `programs` WRITE;
1979/*!40000 ALTER TABLE `programs` DISABLE KEYS */;
1980/*!40000 ALTER TABLE `programs` ENABLE KEYS */;
1981UNLOCK TABLES;
1982
1983--
1984-- Table structure for table `projects`
1985--
1986
1987DROP TABLE IF EXISTS `projects`;
1988/*!40101 SET @saved_cs_client = @@character_set_client */;
1989/*!40101 SET character_set_client = utf8 */;
1990CREATE TABLE `projects` (
1991 `id` int(11) NOT NULL AUTO_INCREMENT,
1992 `modified_by_id` int(11) DEFAULT NULL,
1993 `created_at` datetime NOT NULL,
1994 `updated_at` datetime NOT NULL,
1995 `description` text,
1996 `url` varchar(250) DEFAULT NULL,
1997 `start_date` date DEFAULT NULL,
1998 `end_date` date DEFAULT NULL,
1999 `slug` varchar(250) NOT NULL,
2000 `title` varchar(250) NOT NULL,
2001 `context_id` int(11) DEFAULT NULL,
2002 `contact_id` int(11) DEFAULT NULL,
2003 `notes` text,
2004 `status` varchar(250) DEFAULT NULL,
2005 `reference_url` varchar(250) DEFAULT NULL,
2006 `secondary_contact_id` int(11) DEFAULT NULL,
2007 `os_state` varchar(16) NOT NULL,
2008 PRIMARY KEY (`id`),
2009 UNIQUE KEY `uq_projects` (`slug`),
2010 UNIQUE KEY `uq_t_projects` (`title`),
2011 KEY `fk_projects_contexts` (`context_id`),
2012 KEY `fk_projects_contact` (`contact_id`),
2013 KEY `ix_projects_updated_at` (`updated_at`),
2014 KEY `fk_projects_secondary_contact` (`secondary_contact_id`),
2015 CONSTRAINT `fk_projects_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
2016) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2017/*!40101 SET character_set_client = @saved_cs_client */;
2018
2019--
2020-- Dumping data for table `projects`
2021--
2022
2023LOCK TABLES `projects` WRITE;
2024/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
2025/*!40000 ALTER TABLE `projects` ENABLE KEYS */;
2026UNLOCK TABLES;
2027
2028--
2029-- Table structure for table `relationship_attrs`
2030--
2031
2032DROP TABLE IF EXISTS `relationship_attrs`;
2033/*!40101 SET @saved_cs_client = @@character_set_client */;
2034/*!40101 SET character_set_client = utf8 */;
2035CREATE TABLE `relationship_attrs` (
2036 `id` int(11) NOT NULL AUTO_INCREMENT,
2037 `relationship_id` int(11) NOT NULL,
2038 `attr_name` varchar(250) NOT NULL,
2039 `attr_value` varchar(250) NOT NULL,
2040 PRIMARY KEY (`id`),
2041 KEY `relationship_id` (`relationship_id`),
2042 CONSTRAINT `relationship_attrs_ibfk_1` FOREIGN KEY (`relationship_id`) REFERENCES `relationships` (`id`) ON DELETE CASCADE
2043) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2044/*!40101 SET character_set_client = @saved_cs_client */;
2045
2046--
2047-- Dumping data for table `relationship_attrs`
2048--
2049
2050LOCK TABLES `relationship_attrs` WRITE;
2051/*!40000 ALTER TABLE `relationship_attrs` DISABLE KEYS */;
2052/*!40000 ALTER TABLE `relationship_attrs` ENABLE KEYS */;
2053UNLOCK TABLES;
2054
2055--
2056-- Table structure for table `relationships`
2057--
2058
2059DROP TABLE IF EXISTS `relationships`;
2060/*!40101 SET @saved_cs_client = @@character_set_client */;
2061/*!40101 SET character_set_client = utf8 */;
2062CREATE TABLE `relationships` (
2063 `id` int(11) NOT NULL AUTO_INCREMENT,
2064 `modified_by_id` int(11) DEFAULT NULL,
2065 `created_at` datetime NOT NULL,
2066 `updated_at` datetime NOT NULL,
2067 `source_id` int(11) NOT NULL,
2068 `source_type` varchar(250) NOT NULL,
2069 `destination_id` int(11) NOT NULL,
2070 `destination_type` varchar(250) NOT NULL,
2071 `context_id` int(11) DEFAULT NULL,
2072 `status` varchar(250) DEFAULT NULL,
2073 `automapping_id` int(11) DEFAULT NULL,
2074 PRIMARY KEY (`id`),
2075 UNIQUE KEY `uq_relationships` (`source_id`,`source_type`,`destination_id`,`destination_type`),
2076 KEY `fk_relationships_contexts` (`context_id`),
2077 KEY `ix_relationships_destination` (`destination_type`,`destination_id`),
2078 KEY `ix_relationships_source` (`source_type`,`source_id`),
2079 KEY `ix_relationships_updated_at` (`updated_at`),
2080 KEY `relationships_automapping_parent` (`automapping_id`),
2081 CONSTRAINT `fk_relationships_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2082 CONSTRAINT `relationships_automapping_parent` FOREIGN KEY (`automapping_id`) REFERENCES `relationships` (`id`) ON DELETE SET NULL
2083) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2084/*!40101 SET character_set_client = @saved_cs_client */;
2085
2086--
2087-- Dumping data for table `relationships`
2088--
2089
2090LOCK TABLES `relationships` WRITE;
2091/*!40000 ALTER TABLE `relationships` DISABLE KEYS */;
2092/*!40000 ALTER TABLE `relationships` ENABLE KEYS */;
2093UNLOCK TABLES;
2094
2095--
2096-- Table structure for table `requests`
2097--
2098
2099DROP TABLE IF EXISTS `requests`;
2100/*!40101 SET @saved_cs_client = @@character_set_client */;
2101/*!40101 SET character_set_client = utf8 */;
2102CREATE TABLE `requests` (
2103 `id` int(11) NOT NULL AUTO_INCREMENT,
2104 `request_type` enum('documentation','interview','population sample') NOT NULL,
2105 `status` enum('Not Started','In Progress','Ready for Review','Verified','Completed') NOT NULL,
2106 `start_date` date NOT NULL,
2107 `end_date` date NOT NULL,
2108 `audit_id` int(11) NOT NULL,
2109 `gdrive_upload_path` varchar(250) DEFAULT NULL,
2110 `created_at` datetime NOT NULL,
2111 `modified_by_id` int(11) DEFAULT NULL,
2112 `updated_at` datetime NOT NULL,
2113 `context_id` int(11) DEFAULT NULL,
2114 `test` text,
2115 `notes` text,
2116 `description` text,
2117 `requestor_id` int(11) DEFAULT NULL,
2118 `slug` varchar(250) NOT NULL,
2119 `title` varchar(250) NOT NULL,
2120 `audit_object_id` int(11) DEFAULT NULL,
2121 `finished_date` datetime DEFAULT NULL,
2122 `verified_date` datetime DEFAULT NULL,
2123 `recipients` varchar(250) DEFAULT NULL,
2124 `send_by_default` tinyint(1) DEFAULT NULL,
2125 PRIMARY KEY (`id`),
2126 UNIQUE KEY `uq_requests` (`slug`),
2127 KEY `audit_id` (`audit_id`),
2128 KEY `fk_requests_contexts` (`context_id`),
2129 KEY `ix_requests_updated_at` (`updated_at`),
2130 KEY `requests_audit_objects_ibfk` (`audit_object_id`),
2131 CONSTRAINT `requests_audit_objects_ibfk` FOREIGN KEY (`audit_object_id`) REFERENCES `audit_objects` (`id`),
2132 CONSTRAINT `requests_ibfk_2` FOREIGN KEY (`audit_id`) REFERENCES `audits` (`id`),
2133 CONSTRAINT `requests_ibfk_3` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
2134) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2135/*!40101 SET character_set_client = @saved_cs_client */;
2136
2137--
2138-- Dumping data for table `requests`
2139--
2140
2141LOCK TABLES `requests` WRITE;
2142/*!40000 ALTER TABLE `requests` DISABLE KEYS */;
2143/*!40000 ALTER TABLE `requests` ENABLE KEYS */;
2144UNLOCK TABLES;
2145
2146--
2147-- Table structure for table `revisions`
2148--
2149
2150DROP TABLE IF EXISTS `revisions`;
2151/*!40101 SET @saved_cs_client = @@character_set_client */;
2152/*!40101 SET character_set_client = utf8 */;
2153CREATE TABLE `revisions` (
2154 `id` int(11) NOT NULL AUTO_INCREMENT,
2155 `resource_id` int(11) NOT NULL,
2156 `resource_type` varchar(250) NOT NULL,
2157 `event_id` int(11) NOT NULL,
2158 `action` enum('created','modified','deleted') NOT NULL,
2159 `content` text NOT NULL,
2160 `context_id` int(11) DEFAULT NULL,
2161 `created_at` datetime NOT NULL,
2162 `updated_at` datetime NOT NULL,
2163 `modified_by_id` int(11) DEFAULT NULL,
2164 `source_type` varchar(250) DEFAULT NULL,
2165 `source_id` int(11) DEFAULT NULL,
2166 `destination_type` varchar(250) DEFAULT NULL,
2167 `destination_id` int(11) DEFAULT NULL,
2168 PRIMARY KEY (`id`),
2169 KEY `event_id` (`event_id`),
2170 KEY `revisions_modified_by` (`modified_by_id`),
2171 KEY `fk_revisions_contexts` (`context_id`),
2172 KEY `ix_revisions_updated_at` (`updated_at`),
2173 KEY `fk_revisions_resource` (`resource_type`,`resource_id`),
2174 KEY `fk_revisions_source` (`source_type`,`source_id`),
2175 KEY `fk_revisions_destination` (`destination_type`,`destination_id`),
2176 CONSTRAINT `fk_revisions_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2177 CONSTRAINT `revisions_ibfk_1` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`),
2178 CONSTRAINT `revisions_modified_by` FOREIGN KEY (`modified_by_id`) REFERENCES `people` (`id`)
2179) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
2180/*!40101 SET character_set_client = @saved_cs_client */;
2181
2182--
2183-- Dumping data for table `revisions`
2184--
2185
2186LOCK TABLES `revisions` WRITE;
2187/*!40000 ALTER TABLE `revisions` DISABLE KEYS */;
2188INSERT INTO `revisions` VALUES (1,1,'CustomAttributeDefinition',1,'created','{\"mandatory\": null, \"title\": \"CA dropdown\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"facility\", \"helptext\": null, \"attribute_type\": \"Dropdown\", \"context_id\": null, \"display_name\": \"CA dropdown\", \"multi_choice_options\": \"one,two,three,four,five\", \"id\": 1}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(2,2,'CustomAttributeDefinition',2,'created','{\"mandatory\": null, \"title\": \"CA text\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"facility\", \"helptext\": null, \"attribute_type\": \"Text\", \"context_id\": null, \"display_name\": \"CA text\", \"multi_choice_options\": null, \"id\": 2}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(3,3,'CustomAttributeDefinition',3,'created','{\"mandatory\": null, \"title\": \"CA date\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"facility\", \"helptext\": null, \"attribute_type\": \"Date\", \"context_id\": null, \"display_name\": \"CA date\", \"multi_choice_options\": null, \"id\": 3}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(4,4,'CustomAttributeDefinition',4,'created','{\"mandatory\": null, \"title\": \"CA dropdown\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"control\", \"helptext\": null, \"attribute_type\": \"Dropdown\", \"context_id\": null, \"display_name\": \"CA dropdown\", \"multi_choice_options\": \"one,two,three,four,five\", \"id\": 4}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(5,5,'CustomAttributeDefinition',5,'created','{\"mandatory\": null, \"title\": \"CA text\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"control\", \"helptext\": null, \"attribute_type\": \"Text\", \"context_id\": null, \"display_name\": \"CA text\", \"multi_choice_options\": null, \"id\": 5}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(6,6,'CustomAttributeDefinition',6,'created','{\"mandatory\": null, \"title\": \"CA date\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"control\", \"helptext\": null, \"attribute_type\": \"Date\", \"context_id\": null, \"display_name\": \"CA date\", \"multi_choice_options\": null, \"id\": 6}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(7,7,'CustomAttributeDefinition',7,'created','{\"mandatory\": null, \"title\": \"CA dropdown\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"market\", \"helptext\": null, \"attribute_type\": \"Dropdown\", \"context_id\": null, \"display_name\": \"CA dropdown\", \"multi_choice_options\": \"one,two,three,four,five\", \"id\": 7}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(8,8,'CustomAttributeDefinition',8,'created','{\"mandatory\": null, \"title\": \"CA text\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"market\", \"helptext\": null, \"attribute_type\": \"Text\", \"context_id\": null, \"display_name\": \"CA text\", \"multi_choice_options\": null, \"id\": 8}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(9,9,'CustomAttributeDefinition',9,'created','{\"mandatory\": null, \"title\": \"CA date\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"market\", \"helptext\": null, \"attribute_type\": \"Date\", \"context_id\": null, \"display_name\": \"CA date\", \"multi_choice_options\": null, \"id\": 9}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(10,10,'CustomAttributeDefinition',10,'created','{\"mandatory\": null, \"title\": \"CA dropdown\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"section\", \"helptext\": null, \"attribute_type\": \"Dropdown\", \"context_id\": null, \"display_name\": \"CA dropdown\", \"multi_choice_options\": \"one,two,three,four,five\", \"id\": 10}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(11,11,'CustomAttributeDefinition',11,'created','{\"mandatory\": null, \"title\": \"CA text\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"section\", \"helptext\": null, \"attribute_type\": \"Text\", \"context_id\": null, \"display_name\": \"CA text\", \"multi_choice_options\": null, \"id\": 11}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL),(12,12,'CustomAttributeDefinition',12,'created','{\"mandatory\": null, \"title\": \"CA date\", \"multi_choice_mandatory\": null, \"created_at\": \"2016-11-25T15:50:31\", \"modified_by_id\": null, \"placeholder\": null, \"updated_at\": \"2016-11-25T15:50:31\", \"definition_id\": null, \"definition_type\": \"section\", \"helptext\": null, \"attribute_type\": \"Date\", \"context_id\": null, \"display_name\": \"CA date\", \"multi_choice_options\": null, \"id\": 12}',NULL,'2016-11-25 15:50:31','2016-11-25 15:50:31',1,NULL,NULL,NULL,NULL);
2189/*!40000 ALTER TABLE `revisions` ENABLE KEYS */;
2190UNLOCK TABLES;
2191
2192--
2193-- Table structure for table `risk_assessments`
2194--
2195
2196DROP TABLE IF EXISTS `risk_assessments`;
2197/*!40101 SET @saved_cs_client = @@character_set_client */;
2198/*!40101 SET character_set_client = utf8 */;
2199CREATE TABLE `risk_assessments` (
2200 `id` int(11) NOT NULL AUTO_INCREMENT,
2201 `title` varchar(250) NOT NULL,
2202 `description` text,
2203 `notes` text,
2204 `ra_manager_id` int(11) DEFAULT NULL,
2205 `ra_counsel_id` int(11) DEFAULT NULL,
2206 `start_date` date DEFAULT NULL,
2207 `end_date` date DEFAULT NULL,
2208 `created_at` datetime NOT NULL,
2209 `modified_by_id` int(11) DEFAULT NULL,
2210 `updated_at` datetime NOT NULL,
2211 `context_id` int(11) DEFAULT NULL,
2212 `program_id` int(11) NOT NULL,
2213 `slug` varchar(250) NOT NULL,
2214 PRIMARY KEY (`id`),
2215 UNIQUE KEY `unique_slug` (`slug`),
2216 KEY `fk_risk_assessments_manager_person_id` (`ra_manager_id`),
2217 KEY `fk_risk_assessments_counsel_person_id` (`ra_counsel_id`),
2218 KEY `fk_risk_assessments_contexts` (`context_id`),
2219 KEY `ix_risk_assessments_updated_at` (`updated_at`),
2220 CONSTRAINT `fk_risk_assessments_counsel_person_id` FOREIGN KEY (`ra_counsel_id`) REFERENCES `people` (`id`),
2221 CONSTRAINT `fk_risk_assessments_manager_person_id` FOREIGN KEY (`ra_manager_id`) REFERENCES `people` (`id`),
2222 CONSTRAINT `risk_assessments_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
2223) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2224/*!40101 SET character_set_client = @saved_cs_client */;
2225
2226--
2227-- Dumping data for table `risk_assessments`
2228--
2229
2230LOCK TABLES `risk_assessments` WRITE;
2231/*!40000 ALTER TABLE `risk_assessments` DISABLE KEYS */;
2232/*!40000 ALTER TABLE `risk_assessments` ENABLE KEYS */;
2233UNLOCK TABLES;
2234
2235--
2236-- Table structure for table `risk_objects`
2237--
2238
2239DROP TABLE IF EXISTS `risk_objects`;
2240/*!40101 SET @saved_cs_client = @@character_set_client */;
2241/*!40101 SET character_set_client = utf8 */;
2242CREATE TABLE `risk_objects` (
2243 `id` int(11) NOT NULL AUTO_INCREMENT,
2244 `risk_id` int(11) NOT NULL,
2245 `object_id` int(11) NOT NULL,
2246 `object_type` varchar(250) NOT NULL,
2247 `status` varchar(250) DEFAULT NULL,
2248 `created_at` datetime NOT NULL,
2249 `modified_by_id` int(11) DEFAULT NULL,
2250 `updated_at` datetime NOT NULL,
2251 `context_id` int(11) DEFAULT NULL,
2252 `secondary_contact_id` int(11) DEFAULT NULL,
2253 PRIMARY KEY (`id`),
2254 UNIQUE KEY `risk_id` (`risk_id`,`object_id`,`object_type`),
2255 KEY `fk_risk_objects_contexts` (`context_id`),
2256 KEY `ix_risk_id` (`risk_id`),
2257 KEY `fk_risk_objects_secondary_contact` (`secondary_contact_id`),
2258 CONSTRAINT `risk_objects_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2259 CONSTRAINT `risk_objects_ibfk_2` FOREIGN KEY (`risk_id`) REFERENCES `risks` (`id`)
2260) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2261/*!40101 SET character_set_client = @saved_cs_client */;
2262
2263--
2264-- Dumping data for table `risk_objects`
2265--
2266
2267LOCK TABLES `risk_objects` WRITE;
2268/*!40000 ALTER TABLE `risk_objects` DISABLE KEYS */;
2269/*!40000 ALTER TABLE `risk_objects` ENABLE KEYS */;
2270UNLOCK TABLES;
2271
2272--
2273-- Table structure for table `risks`
2274--
2275
2276DROP TABLE IF EXISTS `risks`;
2277/*!40101 SET @saved_cs_client = @@character_set_client */;
2278/*!40101 SET character_set_client = utf8 */;
2279CREATE TABLE `risks` (
2280 `id` int(11) NOT NULL AUTO_INCREMENT,
2281 `slug` varchar(250) NOT NULL,
2282 `created_at` datetime NOT NULL,
2283 `modified_by_id` int(11) DEFAULT NULL,
2284 `updated_at` datetime NOT NULL,
2285 `context_id` int(11) DEFAULT NULL,
2286 `title` varchar(250) NOT NULL,
2287 `contact_id` int(11) DEFAULT NULL,
2288 `description` text NOT NULL,
2289 `start_date` date DEFAULT NULL,
2290 `end_date` date DEFAULT NULL,
2291 `status` varchar(250) DEFAULT NULL,
2292 `secondary_contact_id` int(11) DEFAULT NULL,
2293 `os_state` varchar(250) NOT NULL,
2294 `notes` text,
2295 `url` varchar(250) DEFAULT NULL,
2296 `reference_url` varchar(250) DEFAULT NULL,
2297 PRIMARY KEY (`id`),
2298 UNIQUE KEY `uq_risks` (`slug`),
2299 UNIQUE KEY `uq_t_risks` (`title`),
2300 KEY `fk_risks_contexts` (`context_id`),
2301 KEY `fk_risks_secondary_contact` (`secondary_contact_id`),
2302 CONSTRAINT `risks_ibfk_1` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
2303) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2304/*!40101 SET character_set_client = @saved_cs_client */;
2305
2306--
2307-- Dumping data for table `risks`
2308--
2309
2310LOCK TABLES `risks` WRITE;
2311/*!40000 ALTER TABLE `risks` DISABLE KEYS */;
2312/*!40000 ALTER TABLE `risks` ENABLE KEYS */;
2313UNLOCK TABLES;
2314
2315--
2316-- Table structure for table `roles`
2317--
2318
2319DROP TABLE IF EXISTS `roles`;
2320/*!40101 SET @saved_cs_client = @@character_set_client */;
2321/*!40101 SET character_set_client = utf8 */;
2322CREATE TABLE `roles` (
2323 `id` int(11) NOT NULL AUTO_INCREMENT,
2324 `name` varchar(128) NOT NULL,
2325 `permissions_json` text NOT NULL,
2326 `description` text,
2327 `modified_by_id` int(11) DEFAULT NULL,
2328 `created_at` datetime NOT NULL,
2329 `updated_at` datetime NOT NULL,
2330 `context_id` int(11) DEFAULT NULL,
2331 `scope` varchar(64) DEFAULT NULL,
2332 `role_order` int(11) DEFAULT NULL,
2333 PRIMARY KEY (`id`),
2334 KEY `fk_roles_contexts` (`context_id`),
2335 KEY `ix_roles_updated_at` (`updated_at`)
2336) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
2337/*!40101 SET character_set_client = @saved_cs_client */;
2338
2339--
2340-- Dumping data for table `roles`
2341--
2342
2343LOCK TABLES `roles` WRITE;
2344/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
2345INSERT INTO `roles` VALUES (1,'ProgramOwner','CODE DECLARED ROLE','User with authorization to peform administrative tasks such as associating users to roles within the scope of of a program.<br/><br/>When a person creates a program they are automatically given the ProgramOwner role. This allows them to Edit, Delete, or Map objects to the Program. It also allows them to add people and assign them roles when their programs are private. ProgramOwner is the most powerful role.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Private Program',1),(2,'ProgramEditor','CODE DECLARED ROLE','A user with authorization to edit mapping objects related to an access controlled program.<br/><br/>When a person has this role they can map and unmap objects to the Program and edit the Program info, but they are unable to delete the Program or assign other people roles for that program.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Private Program',2),(3,'ProgramReader','CODE DECLARED ROLE','A user with authorization to read mapping objects related to an access controlled Program.<br/><br/>This is essentially a view only role. A person with this role can access and view an otherwise private program, but they cannot map to or edit that program in any way.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Private Program',3),(5,'Reader','CODE DECLARED ROLE','This role grants a user basic, read-only, access permission to a gGRC instance.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'System',5),(6,'Editor','CODE DECLARED ROLE','Global Editor',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'System',6),(8,'Administrator','CODE DECLARED ROLE','System Administrator with super-user privileges',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Admin',8),(9,'AuditorReader','CODE DECLARED ROLE','A user with Auditor role for a program audit will also have this role in the default object context so that the auditor will have access to the objects required to perform the audit.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'System Implied',9),(10,'AuditorProgramReader','CODE DECLARED ROLE','A user with Auditor role for a program audit will also have this role in the program context so that the auditor will have access to the private program information and mappings required to perform the audit.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Private Program Implied',10),(11,'ProgramAuditOwner','CODE DECLARED ROLE','A user with the ProgramOwner role for a private program will also have this role in the audit context for any audit created for that program.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Audit Implied',11),(12,'ProgramAuditEditor','CODE DECLARED ROLE','A user with the ProgramEditor role for a private program will also have this role in the audit context for any audit created for that program.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Audit Implied',12),(13,'ProgramAuditReader','CODE DECLARED ROLE','A user with the ProgramReader role for a private program will also have this role in the audit context for any audit created for that program.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Audit Implied',13),(14,'Auditor','CODE DECLARED ROLE','The permissions required by an auditor to access relevant resources for the program being audited.',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Audit',14),(15,'ProgramBasicReader','CODE DECLARED ROLE','Allow any user assigned a role in a program the ability to read Role resources.',1,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Program Implied',15),(16,'ProgramMappingEditor','CODE DECLARED ROLE','\n This role grants a user permission to edit program mappings.\n ',1,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'Private Program Implied',16),(17,'Creator','CODE DECLARED ROLE','Global creator',NULL,'2016-11-25 15:50:21','2016-11-25 15:50:21',NULL,'System',4),(18,'WorkflowOwner','CODE DECLARED ROLE','This role grants a user permission to edit workflow mappings and details',1,'2016-11-25 15:50:23','2016-11-25 15:50:23',NULL,'Workflow',NULL),(19,'WorkflowMember','CODE DECLARED ROLE','This role grants a user permission to edit workflow mappings',1,'2016-11-25 15:50:23','2016-11-25 15:50:23',NULL,'Workflow',NULL),(20,'BasicWorkflowReader','CODE DECLARED ROLE',' ',1,'2016-11-25 15:50:23','2016-11-25 15:50:23',NULL,'Workflow Implied',NULL),(21,'WorkflowBasicReader','CODE DECLARED ROLE',' ',1,'2016-11-25 15:50:23','2016-11-25 15:50:23',NULL,'Workflow Implied',NULL);
2346/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
2347UNLOCK TABLES;
2348
2349--
2350-- Table structure for table `sections`
2351--
2352
2353DROP TABLE IF EXISTS `sections`;
2354/*!40101 SET @saved_cs_client = @@character_set_client */;
2355/*!40101 SET character_set_client = utf8 */;
2356CREATE TABLE `sections` (
2357 `id` int(11) NOT NULL AUTO_INCREMENT,
2358 `modified_by_id` int(11) DEFAULT NULL,
2359 `created_at` datetime NOT NULL,
2360 `updated_at` datetime NOT NULL,
2361 `description` text,
2362 `url` varchar(250) DEFAULT NULL,
2363 `slug` varchar(250) NOT NULL,
2364 `title` varchar(250) NOT NULL,
2365 `na` tinyint(1) NOT NULL,
2366 `notes` text,
2367 `parent_id` int(11) DEFAULT NULL,
2368 `context_id` int(11) DEFAULT NULL,
2369 `contact_id` int(11) DEFAULT NULL,
2370 `reference_url` varchar(250) DEFAULT NULL,
2371 `secondary_contact_id` int(11) DEFAULT NULL,
2372 `os_state` varchar(16) NOT NULL,
2373 `status` varchar(250) DEFAULT NULL,
2374 `end_date` date DEFAULT NULL,
2375 `start_date` date DEFAULT NULL,
2376 PRIMARY KEY (`id`),
2377 UNIQUE KEY `uq_sections` (`slug`),
2378 UNIQUE KEY `uq_t_sections` (`title`),
2379 KEY `parent_id` (`parent_id`),
2380 KEY `fk_sections_contexts` (`context_id`),
2381 KEY `fk_sections_contact` (`contact_id`),
2382 KEY `ix_sections_updated_at` (`updated_at`),
2383 KEY `fk_sections_secondary_contact` (`secondary_contact_id`),
2384 CONSTRAINT `fk_sections_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2385 CONSTRAINT `sections_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `sections` (`id`)
2386) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2387/*!40101 SET character_set_client = @saved_cs_client */;
2388
2389--
2390-- Dumping data for table `sections`
2391--
2392
2393LOCK TABLES `sections` WRITE;
2394/*!40000 ALTER TABLE `sections` DISABLE KEYS */;
2395/*!40000 ALTER TABLE `sections` ENABLE KEYS */;
2396UNLOCK TABLES;
2397
2398--
2399-- Table structure for table `snapshots`
2400--
2401
2402DROP TABLE IF EXISTS `snapshots`;
2403/*!40101 SET @saved_cs_client = @@character_set_client */;
2404/*!40101 SET character_set_client = utf8 */;
2405CREATE TABLE `snapshots` (
2406 `id` int(11) NOT NULL AUTO_INCREMENT,
2407 `parent_id` int(11) NOT NULL,
2408 `parent_type` varchar(250) NOT NULL,
2409 `child_id` int(11) NOT NULL,
2410 `child_type` varchar(250) NOT NULL,
2411 `revision_id` int(11) NOT NULL,
2412 `context_id` int(11) DEFAULT NULL,
2413 `created_at` datetime NOT NULL,
2414 `updated_at` datetime NOT NULL,
2415 `modified_by_id` int(11) DEFAULT NULL,
2416 PRIMARY KEY (`id`),
2417 UNIQUE KEY `parent_type` (`parent_type`,`parent_id`,`child_type`,`child_id`),
2418 KEY `revision_id` (`revision_id`),
2419 KEY `ix_snapshots_parent` (`parent_type`,`parent_id`),
2420 KEY `ix_snapshots_child` (`child_type`,`child_id`),
2421 KEY `fk_snapshots_contexts` (`context_id`),
2422 KEY `ix_snapshots_updated_at` (`updated_at`),
2423 CONSTRAINT `snapshots_ibfk_1` FOREIGN KEY (`revision_id`) REFERENCES `revisions` (`id`)
2424) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2425/*!40101 SET character_set_client = @saved_cs_client */;
2426
2427--
2428-- Dumping data for table `snapshots`
2429--
2430
2431LOCK TABLES `snapshots` WRITE;
2432/*!40000 ALTER TABLE `snapshots` DISABLE KEYS */;
2433/*!40000 ALTER TABLE `snapshots` ENABLE KEYS */;
2434UNLOCK TABLES;
2435
2436--
2437-- Table structure for table `systems`
2438--
2439
2440DROP TABLE IF EXISTS `systems`;
2441/*!40101 SET @saved_cs_client = @@character_set_client */;
2442/*!40101 SET character_set_client = utf8 */;
2443CREATE TABLE `systems` (
2444 `id` int(11) NOT NULL AUTO_INCREMENT,
2445 `modified_by_id` int(11) DEFAULT NULL,
2446 `created_at` datetime NOT NULL,
2447 `updated_at` datetime NOT NULL,
2448 `description` text,
2449 `url` varchar(250) DEFAULT NULL,
2450 `start_date` date DEFAULT NULL,
2451 `end_date` date DEFAULT NULL,
2452 `slug` varchar(250) NOT NULL,
2453 `title` varchar(250) NOT NULL,
2454 `infrastructure` tinyint(1) DEFAULT NULL,
2455 `contact_id` int(11) DEFAULT NULL,
2456 `is_biz_process` tinyint(1) DEFAULT NULL,
2457 `version` varchar(250) DEFAULT NULL,
2458 `notes` text,
2459 `network_zone_id` int(11) DEFAULT NULL,
2460 `context_id` int(11) DEFAULT NULL,
2461 `status` varchar(250) DEFAULT NULL,
2462 `reference_url` varchar(250) DEFAULT NULL,
2463 `secondary_contact_id` int(11) DEFAULT NULL,
2464 `os_state` varchar(16) NOT NULL,
2465 PRIMARY KEY (`id`),
2466 UNIQUE KEY `uq_systems` (`slug`),
2467 UNIQUE KEY `uq_t_systems` (`title`),
2468 KEY `fk_systems_contexts` (`context_id`),
2469 KEY `fk_systems_contact` (`contact_id`),
2470 KEY `ix_systems_is_biz_process` (`is_biz_process`),
2471 KEY `ix_systems_updated_at` (`updated_at`),
2472 KEY `fk_systems_secondary_contact` (`secondary_contact_id`),
2473 CONSTRAINT `fk_systems_contexts` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
2474) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2475/*!40101 SET character_set_client = @saved_cs_client */;
2476
2477--
2478-- Dumping data for table `systems`
2479--
2480
2481LOCK TABLES `systems` WRITE;
2482/*!40000 ALTER TABLE `systems` DISABLE KEYS */;
2483/*!40000 ALTER TABLE `systems` ENABLE KEYS */;
2484UNLOCK TABLES;
2485
2486--
2487-- Table structure for table `task_group_objects`
2488--
2489
2490DROP TABLE IF EXISTS `task_group_objects`;
2491/*!40101 SET @saved_cs_client = @@character_set_client */;
2492/*!40101 SET character_set_client = utf8 */;
2493CREATE TABLE `task_group_objects` (
2494 `id` int(11) NOT NULL AUTO_INCREMENT,
2495 `task_group_id` int(11) NOT NULL,
2496 `object_id` int(11) NOT NULL,
2497 `object_type` varchar(250) NOT NULL,
2498 `end_date` date DEFAULT NULL,
2499 `start_date` date DEFAULT NULL,
2500 `status` varchar(250) DEFAULT NULL,
2501 `created_at` datetime NOT NULL,
2502 `modified_by_id` int(11) DEFAULT NULL,
2503 `updated_at` datetime NOT NULL,
2504 `context_id` int(11) DEFAULT NULL,
2505 PRIMARY KEY (`id`),
2506 UNIQUE KEY `task_group_id` (`task_group_id`,`object_id`,`object_type`),
2507 KEY `fk_task_group_objects_contexts` (`context_id`),
2508 KEY `ix_task_group_id` (`task_group_id`),
2509 KEY `ix_task_group_objects_updated_at` (`updated_at`),
2510 CONSTRAINT `fk_task_group_objects_context_id` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2511 CONSTRAINT `fk_task_group_objects_task_group_id` FOREIGN KEY (`task_group_id`) REFERENCES `task_groups` (`id`) ON DELETE CASCADE
2512) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2513/*!40101 SET character_set_client = @saved_cs_client */;
2514
2515--
2516-- Dumping data for table `task_group_objects`
2517--
2518
2519LOCK TABLES `task_group_objects` WRITE;
2520/*!40000 ALTER TABLE `task_group_objects` DISABLE KEYS */;
2521/*!40000 ALTER TABLE `task_group_objects` ENABLE KEYS */;
2522UNLOCK TABLES;
2523
2524--
2525-- Table structure for table `task_group_tasks`
2526--
2527
2528DROP TABLE IF EXISTS `task_group_tasks`;
2529/*!40101 SET @saved_cs_client = @@character_set_client */;
2530/*!40101 SET character_set_client = utf8 */;
2531CREATE TABLE `task_group_tasks` (
2532 `id` int(11) NOT NULL AUTO_INCREMENT,
2533 `task_group_id` int(11) NOT NULL,
2534 `end_date` date DEFAULT NULL,
2535 `start_date` date DEFAULT NULL,
2536 `created_at` datetime NOT NULL,
2537 `modified_by_id` int(11) DEFAULT NULL,
2538 `updated_at` datetime NOT NULL,
2539 `context_id` int(11) DEFAULT NULL,
2540 `sort_index` varchar(250) NOT NULL,
2541 `contact_id` int(11) DEFAULT NULL,
2542 `description` text,
2543 `title` varchar(250) NOT NULL,
2544 `relative_end_day` int(11) DEFAULT NULL,
2545 `relative_end_month` int(11) DEFAULT NULL,
2546 `relative_start_day` int(11) DEFAULT NULL,
2547 `relative_start_month` int(11) DEFAULT NULL,
2548 `object_approval` tinyint(1) NOT NULL,
2549 `response_options` text NOT NULL,
2550 `task_type` varchar(250) NOT NULL,
2551 `secondary_contact_id` int(11) DEFAULT NULL,
2552 `slug` varchar(250) NOT NULL,
2553 PRIMARY KEY (`id`),
2554 UNIQUE KEY `unique_slug` (`slug`),
2555 KEY `fk_task_group_tasks_contexts` (`context_id`),
2556 KEY `fk_task_group_tasks_contact` (`contact_id`),
2557 KEY `ix_task_group_tasks_updated_at` (`updated_at`),
2558 KEY `fk_task_group_tasks_secondary_contact` (`secondary_contact_id`),
2559 KEY `fk_task_group_tasks_task_group_id` (`task_group_id`),
2560 CONSTRAINT `fk_task_group_tasks_context_id` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2561 CONSTRAINT `fk_task_group_tasks_task_group_id` FOREIGN KEY (`task_group_id`) REFERENCES `task_groups` (`id`) ON DELETE CASCADE
2562) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2563/*!40101 SET character_set_client = @saved_cs_client */;
2564
2565--
2566-- Dumping data for table `task_group_tasks`
2567--
2568
2569LOCK TABLES `task_group_tasks` WRITE;
2570/*!40000 ALTER TABLE `task_group_tasks` DISABLE KEYS */;
2571/*!40000 ALTER TABLE `task_group_tasks` ENABLE KEYS */;
2572UNLOCK TABLES;
2573
2574--
2575-- Table structure for table `task_groups`
2576--
2577
2578DROP TABLE IF EXISTS `task_groups`;
2579/*!40101 SET @saved_cs_client = @@character_set_client */;
2580/*!40101 SET character_set_client = utf8 */;
2581CREATE TABLE `task_groups` (
2582 `id` int(11) NOT NULL AUTO_INCREMENT,
2583 `workflow_id` int(11) NOT NULL,
2584 `contact_id` int(11) DEFAULT NULL,
2585 `end_date` date DEFAULT NULL,
2586 `start_date` date DEFAULT NULL,
2587 `description` text,
2588 `title` varchar(250) NOT NULL,
2589 `slug` varchar(250) NOT NULL,
2590 `created_at` datetime NOT NULL,
2591 `modified_by_id` int(11) DEFAULT NULL,
2592 `updated_at` datetime NOT NULL,
2593 `context_id` int(11) DEFAULT NULL,
2594 `lock_task_order` tinyint(1) DEFAULT NULL,
2595 `sort_index` varchar(250) NOT NULL,
2596 `secondary_contact_id` int(11) DEFAULT NULL,
2597 PRIMARY KEY (`id`),
2598 UNIQUE KEY `uq_task_groups` (`slug`),
2599 KEY `fk_task_groups_contact` (`contact_id`),
2600 KEY `fk_task_groups_contexts` (`context_id`),
2601 KEY `ix_task_groups_updated_at` (`updated_at`),
2602 KEY `fk_task_groups_secondary_contact` (`secondary_contact_id`),
2603 KEY `fk_task_groups_workflow_id` (`workflow_id`),
2604 CONSTRAINT `fk_task_groups_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `people` (`id`),
2605 CONSTRAINT `fk_task_groups_context_id` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2606 CONSTRAINT `fk_task_groups_workflow_id` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE
2607) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2608/*!40101 SET character_set_client = @saved_cs_client */;
2609
2610--
2611-- Dumping data for table `task_groups`
2612--
2613
2614LOCK TABLES `task_groups` WRITE;
2615/*!40000 ALTER TABLE `task_groups` DISABLE KEYS */;
2616/*!40000 ALTER TABLE `task_groups` ENABLE KEYS */;
2617UNLOCK TABLES;
2618
2619--
2620-- Table structure for table `threats`
2621--
2622
2623DROP TABLE IF EXISTS `threats`;
2624/*!40101 SET @saved_cs_client = @@character_set_client */;
2625/*!40101 SET character_set_client = utf8 */;
2626CREATE TABLE `threats` (
2627 `id` int(11) NOT NULL AUTO_INCREMENT,
2628 `modified_by_id` int(11) DEFAULT NULL,
2629 `created_at` datetime NOT NULL,
2630 `updated_at` datetime NOT NULL,
2631 `description` text,
2632 `url` varchar(250) DEFAULT NULL,
2633 `start_date` date DEFAULT NULL,
2634 `end_date` date DEFAULT NULL,
2635 `slug` varchar(250) NOT NULL,
2636 `title` varchar(250) NOT NULL,
2637 `context_id` int(11) DEFAULT NULL,
2638 `contact_id` int(11) DEFAULT NULL,
2639 `notes` text,
2640 `status` varchar(250) DEFAULT NULL,
2641 `reference_url` varchar(250) DEFAULT NULL,
2642 `secondary_contact_id` int(11) DEFAULT NULL,
2643 `os_state` varchar(250) NOT NULL,
2644 PRIMARY KEY (`id`),
2645 UNIQUE KEY `uq_t_actors` (`title`),
2646 UNIQUE KEY `uq_threats` (`slug`),
2647 KEY `fk_threat_actors_secondary_contact` (`secondary_contact_id`)
2648) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2649/*!40101 SET character_set_client = @saved_cs_client */;
2650
2651--
2652-- Dumping data for table `threats`
2653--
2654
2655LOCK TABLES `threats` WRITE;
2656/*!40000 ALTER TABLE `threats` DISABLE KEYS */;
2657/*!40000 ALTER TABLE `threats` ENABLE KEYS */;
2658UNLOCK TABLES;
2659
2660--
2661-- Table structure for table `user_roles`
2662--
2663
2664DROP TABLE IF EXISTS `user_roles`;
2665/*!40101 SET @saved_cs_client = @@character_set_client */;
2666/*!40101 SET character_set_client = utf8 */;
2667CREATE TABLE `user_roles` (
2668 `id` int(11) NOT NULL AUTO_INCREMENT,
2669 `role_id` int(11) NOT NULL,
2670 `modified_by_id` int(11) DEFAULT NULL,
2671 `created_at` datetime NOT NULL,
2672 `updated_at` datetime NOT NULL,
2673 `context_id` int(11) DEFAULT NULL,
2674 `person_id` int(11) NOT NULL,
2675 PRIMARY KEY (`id`),
2676 UNIQUE KEY `unique_role_context_person` (`role_id`,`context_id`,`person_id`),
2677 KEY `fk_user_roles_contexts` (`context_id`),
2678 KEY `ix_user_roles_person` (`person_id`),
2679 KEY `ix_user_roles_updated_at` (`updated_at`),
2680 CONSTRAINT `user_roles_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
2681) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2682/*!40101 SET character_set_client = @saved_cs_client */;
2683
2684--
2685-- Dumping data for table `user_roles`
2686--
2687
2688LOCK TABLES `user_roles` WRITE;
2689/*!40000 ALTER TABLE `user_roles` DISABLE KEYS */;
2690/*!40000 ALTER TABLE `user_roles` ENABLE KEYS */;
2691UNLOCK TABLES;
2692
2693--
2694-- Table structure for table `vendors`
2695--
2696
2697DROP TABLE IF EXISTS `vendors`;
2698/*!40101 SET @saved_cs_client = @@character_set_client */;
2699/*!40101 SET character_set_client = utf8 */;
2700CREATE TABLE `vendors` (
2701 `id` int(11) NOT NULL AUTO_INCREMENT,
2702 `modified_by_id` int(11) DEFAULT NULL,
2703 `created_at` datetime NOT NULL,
2704 `updated_at` datetime NOT NULL,
2705 `description` text,
2706 `url` varchar(250) DEFAULT NULL,
2707 `start_date` datetime DEFAULT NULL,
2708 `end_date` datetime DEFAULT NULL,
2709 `slug` varchar(250) NOT NULL,
2710 `title` varchar(250) NOT NULL,
2711 `context_id` int(11) DEFAULT NULL,
2712 `contact_id` int(11) DEFAULT NULL,
2713 `notes` text,
2714 `status` varchar(250) NOT NULL,
2715 `reference_url` varchar(250) DEFAULT NULL,
2716 `secondary_contact_id` int(11) DEFAULT NULL,
2717 `os_state` varchar(16) NOT NULL,
2718 PRIMARY KEY (`id`),
2719 UNIQUE KEY `uq_vendors_title` (`title`),
2720 UNIQUE KEY `uq_slug_vendors` (`slug`),
2721 KEY `fk_vendors_context` (`context_id`),
2722 KEY `fk_vendors_contact` (`contact_id`),
2723 KEY `fk_vendors_modified_by` (`modified_by_id`),
2724 KEY `fk_vendors_status` (`status`),
2725 KEY `ix_vendors_updated_at` (`updated_at`),
2726 KEY `fk_vendors_secondary_contact` (`secondary_contact_id`)
2727) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2728/*!40101 SET character_set_client = @saved_cs_client */;
2729
2730--
2731-- Dumping data for table `vendors`
2732--
2733
2734LOCK TABLES `vendors` WRITE;
2735/*!40000 ALTER TABLE `vendors` DISABLE KEYS */;
2736/*!40000 ALTER TABLE `vendors` ENABLE KEYS */;
2737UNLOCK TABLES;
2738
2739--
2740-- Table structure for table `workflow_people`
2741--
2742
2743DROP TABLE IF EXISTS `workflow_people`;
2744/*!40101 SET @saved_cs_client = @@character_set_client */;
2745/*!40101 SET character_set_client = utf8 */;
2746CREATE TABLE `workflow_people` (
2747 `id` int(11) NOT NULL AUTO_INCREMENT,
2748 `workflow_id` int(11) NOT NULL,
2749 `person_id` int(11) NOT NULL,
2750 `status` varchar(250) DEFAULT NULL,
2751 `created_at` datetime NOT NULL,
2752 `modified_by_id` int(11) DEFAULT NULL,
2753 `updated_at` datetime NOT NULL,
2754 `context_id` int(11) DEFAULT NULL,
2755 PRIMARY KEY (`id`),
2756 UNIQUE KEY `workflow_id` (`workflow_id`,`person_id`),
2757 KEY `fk_workflow_people_contexts` (`context_id`),
2758 KEY `ix_person_id` (`person_id`),
2759 KEY `ix_workflow_id` (`workflow_id`),
2760 KEY `ix_workflow_people_updated_at` (`updated_at`),
2761 CONSTRAINT `fk_workflow_people_context_id` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`),
2762 CONSTRAINT `fk_workflow_people_person_id` FOREIGN KEY (`person_id`) REFERENCES `people` (`id`),
2763 CONSTRAINT `fk_workflow_people_workflow_id` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE
2764) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2765/*!40101 SET character_set_client = @saved_cs_client */;
2766
2767--
2768-- Dumping data for table `workflow_people`
2769--
2770
2771LOCK TABLES `workflow_people` WRITE;
2772/*!40000 ALTER TABLE `workflow_people` DISABLE KEYS */;
2773/*!40000 ALTER TABLE `workflow_people` ENABLE KEYS */;
2774UNLOCK TABLES;
2775
2776--
2777-- Table structure for table `workflows`
2778--
2779
2780DROP TABLE IF EXISTS `workflows`;
2781/*!40101 SET @saved_cs_client = @@character_set_client */;
2782/*!40101 SET character_set_client = utf8 */;
2783CREATE TABLE `workflows` (
2784 `id` int(11) NOT NULL AUTO_INCREMENT,
2785 `end_date` date DEFAULT NULL,
2786 `start_date` date DEFAULT NULL,
2787 `description` text,
2788 `title` varchar(250) NOT NULL,
2789 `slug` varchar(250) NOT NULL,
2790 `created_at` datetime NOT NULL,
2791 `modified_by_id` int(11) DEFAULT NULL,
2792 `updated_at` datetime NOT NULL,
2793 `context_id` int(11) DEFAULT NULL,
2794 `frequency` varchar(250) DEFAULT NULL,
2795 `notify_custom_message` text,
2796 `notify_on_change` tinyint(1) NOT NULL,
2797 `object_approval` tinyint(1) NOT NULL,
2798 `next_cycle_start_date` date DEFAULT NULL,
2799 `status` varchar(250) DEFAULT NULL,
2800 `recurrences` tinyint(1) NOT NULL,
2801 `non_adjusted_next_cycle_start_date` date DEFAULT NULL,
2802 `is_old_workflow` tinyint(1) DEFAULT NULL,
2803 `kind` varchar(250) DEFAULT NULL,
2804 PRIMARY KEY (`id`),
2805 UNIQUE KEY `uq_workflows` (`slug`),
2806 KEY `fk_workflows_contexts` (`context_id`),
2807 KEY `ix_workflows_updated_at` (`updated_at`),
2808 CONSTRAINT `fk_workflows_context_id` FOREIGN KEY (`context_id`) REFERENCES `contexts` (`id`)
2809) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2810/*!40101 SET character_set_client = @saved_cs_client */;
2811
2812--
2813-- Dumping data for table `workflows`
2814--
2815
2816LOCK TABLES `workflows` WRITE;
2817/*!40000 ALTER TABLE `workflows` DISABLE KEYS */;
2818/*!40000 ALTER TABLE `workflows` ENABLE KEYS */;
2819UNLOCK TABLES;
2820/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
2821
2822/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
2823/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
2824/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
2825/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
2826/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
2827/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
2828/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
2829
2830-- Dump completed on 2016-11-25 15:51:05