Commit d64c932a11b44c9acf507079b01d01beba8a3ba4

Authored by kevin_fourie
1 parent b0a31f39

KTS-2373

"Update structure.sql and data.sql"
Updated. Upgrades added and now using mysqldump to produce dumps.

Committed By: Kevin Fourie
Reviewed By: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7228 c91229c3-7414-0410-bfa2-8a42b809f60b
sql/mysql/install/data.sql
No preview for this file type
sql/mysql/install/dump.sh 0 → 100755
  1 +#!/bin/sh
  2 +
  3 +DIR=`dirname $0`
  4 +cd $DIR
  5 +
  6 +case $1 in
  7 +'') DB=dms_clean ;;
  8 +*) DB=$1 ;;
  9 +esac
  10 +
  11 +DATE=`date +%Y-%m-%d-%H-%M-%S`
  12 +
  13 +# Create the Structure Dump
  14 +../../../../mysql/bin/mysqldump -u root -p $DB --no-data --skip-add-drop-table > structure-$DATE.sql
  15 +
  16 +# Create the Data Dump
  17 +../../../../mysql/bin/mysqldump -u root -p $DB --no-create-info > data-$DATE.sql
... ...
sql/mysql/install/structure.sql
1 1 --
2   --- $Id$
  2 +-- $Id:$
3 3 --
4 4 -- The contents of this file are subject to the KnowledgeTree Public
5 5 -- License Version 1.1.2 ("License"); You may not use this file except in
... ... @@ -26,17 +26,26 @@
26 26 -- All Rights Reserved.
27 27 -- Contributor( s): ______________________________________
28 28 --
  29 +-- MySQL dump 10.11
  30 +--
  31 +-- Host: localhost Database: dms_clean
  32 +-- ------------------------------------------------------
  33 +-- Server version 5.0.37
  34 +
  35 +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  36 +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  37 +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  38 +/*!40101 SET NAMES utf8 */;
  39 +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  40 +/*!40103 SET TIME_ZONE='+00:00' */;
  41 +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  42 +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  43 +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  44 +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
29 45  
30   -SET FOREIGN_KEY_CHECKS=0;
31   ---
32   --- Database: `pristine`
33   ---
34   -
35   --- --------------------------------------------------------
36   -
37   ---
  46 +--
38 47 -- Table structure for table `active_sessions`
39   ---
  48 +--
40 49  
41 50 CREATE TABLE `active_sessions` (
42 51 `id` int(11) NOT NULL default '0',
... ... @@ -48,11 +57,9 @@ CREATE TABLE `active_sessions` (
48 57 KEY `session_id_idx` (`session_id`)
49 58 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
50 59  
51   --- --------------------------------------------------------
52   -
53   ---
  60 +--
54 61 -- Table structure for table `archive_restoration_request`
55   ---
  62 +--
56 63  
57 64 CREATE TABLE `archive_restoration_request` (
58 65 `id` int(11) NOT NULL default '0',
... ... @@ -63,11 +70,9 @@ CREATE TABLE `archive_restoration_request` (
63 70 UNIQUE KEY `id` (`id`)
64 71 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
65 72  
66   --- --------------------------------------------------------
67   -
68   ---
  73 +--
69 74 -- Table structure for table `archiving_settings`
70   ---
  75 +--
71 76  
72 77 CREATE TABLE `archiving_settings` (
73 78 `id` int(11) NOT NULL default '0',
... ... @@ -78,11 +83,9 @@ CREATE TABLE `archiving_settings` (
78 83 UNIQUE KEY `id` (`id`)
79 84 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
80 85  
81   --- --------------------------------------------------------
82   -
83   ---
  86 +--
84 87 -- Table structure for table `archiving_type_lookup`
85   ---
  88 +--
86 89  
87 90 CREATE TABLE `archiving_type_lookup` (
88 91 `id` int(11) NOT NULL default '0',
... ... @@ -90,11 +93,9 @@ CREATE TABLE `archiving_type_lookup` (
90 93 UNIQUE KEY `id` (`id`)
91 94 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
92 95  
93   --- --------------------------------------------------------
94   -
95   ---
  96 +--
96 97 -- Table structure for table `authentication_sources`
97   ---
  98 +--
98 99  
99 100 CREATE TABLE `authentication_sources` (
100 101 `id` int(11) NOT NULL default '0',
... ... @@ -108,11 +109,9 @@ CREATE TABLE `authentication_sources` (
108 109 KEY `namespace` (`namespace`)
109 110 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
110 111  
111   --- --------------------------------------------------------
112   -
113   ---
  112 +--
114 113 -- Table structure for table `column_entries`
115   ---
  114 +--
116 115  
117 116 CREATE TABLE `column_entries` (
118 117 `id` int(11) NOT NULL default '0',
... ... @@ -125,11 +124,9 @@ CREATE TABLE `column_entries` (
125 124 KEY `view_namespace` (`view_namespace`)
126 125 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
127 126  
128   --- --------------------------------------------------------
129   -
130   ---
  127 +--
131 128 -- Table structure for table `comment_searchable_text`
132   ---
  129 +--
133 130  
134 131 CREATE TABLE `comment_searchable_text` (
135 132 `comment_id` int(11) NOT NULL default '0',
... ... @@ -139,11 +136,9 @@ CREATE TABLE `comment_searchable_text` (
139 136 FULLTEXT KEY `comment_search_text` (`body`)
140 137 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
141 138  
142   --- --------------------------------------------------------
143   -
144   ---
  139 +--
145 140 -- Table structure for table `dashlet_disables`
146   ---
  141 +--
147 142  
148 143 CREATE TABLE `dashlet_disables` (
149 144 `id` int(11) NOT NULL default '0',
... ... @@ -154,11 +149,9 @@ CREATE TABLE `dashlet_disables` (
154 149 KEY `dashlet_namespace` (`dashlet_namespace`)
155 150 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
156 151  
157   --- --------------------------------------------------------
158   -
159   ---
  152 +--
160 153 -- Table structure for table `data_types`
161   ---
  154 +--
162 155  
163 156 CREATE TABLE `data_types` (
164 157 `id` int(11) NOT NULL default '0',
... ... @@ -166,11 +159,9 @@ CREATE TABLE `data_types` (
166 159 UNIQUE KEY `id` (`id`)
167 160 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
168 161  
169   --- --------------------------------------------------------
170   -
171   ---
  162 +--
172 163 -- Table structure for table `discussion_comments`
173   ---
  164 +--
174 165  
175 166 CREATE TABLE `discussion_comments` (
176 167 `id` int(11) NOT NULL default '0',
... ... @@ -183,11 +174,9 @@ CREATE TABLE `discussion_comments` (
183 174 UNIQUE KEY `id` (`id`)
184 175 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
185 176  
186   --- --------------------------------------------------------
187   -
188   ---
  177 +--
189 178 -- Table structure for table `discussion_threads`
190   ---
  179 +--
191 180  
192 181 CREATE TABLE `discussion_threads` (
193 182 `id` int(11) NOT NULL default '0',
... ... @@ -203,11 +192,9 @@ CREATE TABLE `discussion_threads` (
203 192 UNIQUE KEY `id` (`id`)
204 193 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
205 194  
206   --- --------------------------------------------------------
207   -
208   ---
  195 +--
209 196 -- Table structure for table `document_archiving_link`
210   ---
  197 +--
211 198  
212 199 CREATE TABLE `document_archiving_link` (
213 200 `id` int(11) NOT NULL default '0',
... ... @@ -216,11 +203,9 @@ CREATE TABLE `document_archiving_link` (
216 203 UNIQUE KEY `id` (`id`)
217 204 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
218 205  
219   --- --------------------------------------------------------
220   -
221   ---
  206 +--
222 207 -- Table structure for table `document_content_version`
223   ---
  208 +--
224 209  
225 210 CREATE TABLE `document_content_version` (
226 211 `id` int(11) NOT NULL default '0',
... ... @@ -236,11 +221,9 @@ CREATE TABLE `document_content_version` (
236 221 KEY `document_id` (`document_id`)
237 222 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
238 223  
239   --- --------------------------------------------------------
240   -
241   ---
  224 +--
242 225 -- Table structure for table `document_fields`
243   ---
  226 +--
244 227  
245 228 CREATE TABLE `document_fields` (
246 229 `id` int(11) NOT NULL default '0',
... ... @@ -253,14 +236,13 @@ CREATE TABLE `document_fields` (
253 236 `is_mandatory` tinyint(4) NOT NULL default '0',
254 237 `description` mediumtext NOT NULL,
255 238 UNIQUE KEY `id` (`id`),
256   - KEY `parent_fieldset` (`parent_fieldset`)
  239 + KEY `parent_fieldset` (`parent_fieldset`),
  240 + CONSTRAINT `document_fields_ibfk_1` FOREIGN KEY (`parent_fieldset`) REFERENCES `fieldsets` (`id`) ON DELETE CASCADE
257 241 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
258 242  
259   --- --------------------------------------------------------
260   -
261   ---
  243 +--
262 244 -- Table structure for table `document_fields_link`
263   ---
  245 +--
264 246  
265 247 CREATE TABLE `document_fields_link` (
266 248 `id` int(11) NOT NULL default '0',
... ... @@ -269,14 +251,13 @@ CREATE TABLE `document_fields_link` (
269 251 `metadata_version_id` int(11) default NULL,
270 252 UNIQUE KEY `id` (`id`),
271 253 KEY `document_field_id` (`document_field_id`),
272   - KEY `metadata_version_id` (`metadata_version_id`)
  254 + KEY `metadata_version_id` (`metadata_version_id`),
  255 + CONSTRAINT `document_fields_link_ibfk_2` FOREIGN KEY (`document_field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE
273 256 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
274 257  
275   --- --------------------------------------------------------
276   -
277   ---
  258 +--
278 259 -- Table structure for table `document_incomplete`
279   ---
  260 +--
280 261  
281 262 CREATE TABLE `document_incomplete` (
282 263 `id` int(10) unsigned NOT NULL default '0',
... ... @@ -285,11 +266,9 @@ CREATE TABLE `document_incomplete` (
285 266 PRIMARY KEY (`id`)
286 267 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
287 268  
288   --- --------------------------------------------------------
289   -
290   ---
  269 +--
291 270 -- Table structure for table `document_link`
292   ---
  271 +--
293 272  
294 273 CREATE TABLE `document_link` (
295 274 `id` int(11) NOT NULL default '0',
... ... @@ -299,11 +278,9 @@ CREATE TABLE `document_link` (
299 278 UNIQUE KEY `id` (`id`)
300 279 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
301 280  
302   --- --------------------------------------------------------
303   -
304   ---
  281 +--
305 282 -- Table structure for table `document_link_types`
306   ---
  283 +--
307 284  
308 285 CREATE TABLE `document_link_types` (
309 286 `id` int(11) NOT NULL default '0',
... ... @@ -313,11 +290,9 @@ CREATE TABLE `document_link_types` (
313 290 UNIQUE KEY `id` (`id`)
314 291 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
315 292  
316   --- --------------------------------------------------------
317   -
318   ---
  293 +--
319 294 -- Table structure for table `document_metadata_version`
320   ---
  295 +--
321 296  
322 297 CREATE TABLE `document_metadata_version` (
323 298 `id` int(11) NOT NULL default '0',
... ... @@ -340,14 +315,18 @@ CREATE TABLE `document_metadata_version` (
340 315 KEY `version_creator_id` (`version_creator_id`),
341 316 KEY `content_version_id` (`content_version_id`),
342 317 KEY `workflow_id` (`workflow_id`),
343   - KEY `workflow_state_id` (`workflow_state_id`)
  318 + KEY `workflow_state_id` (`workflow_state_id`),
  319 + CONSTRAINT `document_metadata_version_ibfk_4` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE,
  320 + CONSTRAINT `document_metadata_version_ibfk_5` FOREIGN KEY (`document_type_id`) REFERENCES `document_types_lookup` (`id`),
  321 + CONSTRAINT `document_metadata_version_ibfk_6` FOREIGN KEY (`status_id`) REFERENCES `status_lookup` (`id`),
  322 + CONSTRAINT `document_metadata_version_ibfk_7` FOREIGN KEY (`version_creator_id`) REFERENCES `users` (`id`),
  323 + CONSTRAINT `document_metadata_version_ibfk_8` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`),
  324 + CONSTRAINT `document_metadata_version_ibfk_9` FOREIGN KEY (`workflow_state_id`) REFERENCES `workflow_states` (`id`)
344 325 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
345 326  
346   --- --------------------------------------------------------
347   -
348   ---
  327 +--
349 328 -- Table structure for table `document_role_allocations`
350   ---
  329 +--
351 330  
352 331 CREATE TABLE `document_role_allocations` (
353 332 `id` int(11) NOT NULL default '0',
... ... @@ -358,11 +337,9 @@ CREATE TABLE `document_role_allocations` (
358 337 KEY `document_id` (`document_id`)
359 338 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
360 339  
361   --- --------------------------------------------------------
362   -
363   ---
  340 +--
364 341 -- Table structure for table `document_searchable_text`
365   ---
  342 +--
366 343  
367 344 CREATE TABLE `document_searchable_text` (
368 345 `document_id` int(11) default NULL,
... ... @@ -371,11 +348,9 @@ CREATE TABLE `document_searchable_text` (
371 348 FULLTEXT KEY `document_text` (`document_text`)
372 349 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
373 350  
374   --- --------------------------------------------------------
375   -
376   ---
  351 +--
377 352 -- Table structure for table `document_subscriptions`
378   ---
  353 +--
379 354  
380 355 CREATE TABLE `document_subscriptions` (
381 356 `id` int(11) NOT NULL default '0',
... ... @@ -385,11 +360,22 @@ CREATE TABLE `document_subscriptions` (
385 360 UNIQUE KEY `id` (`id`)
386 361 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
387 362  
388   --- --------------------------------------------------------
  363 +--
  364 +-- Table structure for table `document_tags`
  365 +--
389 366  
390   ---
  367 +CREATE TABLE `document_tags` (
  368 + `document_id` int(10) NOT NULL,
  369 + `tag_id` int(10) NOT NULL,
  370 + PRIMARY KEY (`document_id`,`tag_id`),
  371 + KEY `fk_document_tags_tag_id` (`tag_id`),
  372 + CONSTRAINT `fk_document_tags_document_id` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  373 + CONSTRAINT `fk_document_tags_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `tag_words` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  374 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  375 +
  376 +--
391 377 -- Table structure for table `document_text`
392   ---
  378 +--
393 379  
394 380 CREATE TABLE `document_text` (
395 381 `document_id` int(11) default NULL,
... ... @@ -398,11 +384,9 @@ CREATE TABLE `document_text` (
398 384 FULLTEXT KEY `document_text` (`document_text`)
399 385 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
400 386  
401   --- --------------------------------------------------------
402   -
403   ---
  387 +--
404 388 -- Table structure for table `document_transaction_text`
405   ---
  389 +--
406 390  
407 391 CREATE TABLE `document_transaction_text` (
408 392 `document_id` int(11) default NULL,
... ... @@ -411,11 +395,9 @@ CREATE TABLE `document_transaction_text` (
411 395 FULLTEXT KEY `document_text` (`document_text`)
412 396 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
413 397  
414   --- --------------------------------------------------------
415   -
416   ---
  398 +--
417 399 -- Table structure for table `document_transaction_types_lookup`
418   ---
  400 +--
419 401  
420 402 CREATE TABLE `document_transaction_types_lookup` (
421 403 `id` int(11) NOT NULL default '0',
... ... @@ -425,11 +407,9 @@ CREATE TABLE `document_transaction_types_lookup` (
425 407 KEY `namespace` (`namespace`)
426 408 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
427 409  
428   --- --------------------------------------------------------
429   -
430   ---
  410 +--
431 411 -- Table structure for table `document_transactions`
432   ---
  412 +--
433 413  
434 414 CREATE TABLE `document_transactions` (
435 415 `id` int(11) NOT NULL default '0',
... ... @@ -449,11 +429,9 @@ CREATE TABLE `document_transactions` (
449 429 KEY `session_id` (`session_id`)
450 430 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
451 431  
452   --- --------------------------------------------------------
453   -
454   ---
  432 +--
455 433 -- Table structure for table `document_type_fields_link`
456   ---
  434 +--
457 435  
458 436 CREATE TABLE `document_type_fields_link` (
459 437 `id` int(11) NOT NULL default '0',
... ... @@ -463,11 +441,9 @@ CREATE TABLE `document_type_fields_link` (
463 441 UNIQUE KEY `id` (`id`)
464 442 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
465 443  
466   --- --------------------------------------------------------
467   -
468   ---
  444 +--
469 445 -- Table structure for table `document_type_fieldsets_link`
470   ---
  446 +--
471 447  
472 448 CREATE TABLE `document_type_fieldsets_link` (
473 449 `id` int(11) NOT NULL default '0',
... ... @@ -475,14 +451,14 @@ CREATE TABLE `document_type_fieldsets_link` (
475 451 `fieldset_id` int(11) NOT NULL default '0',
476 452 UNIQUE KEY `id` (`id`),
477 453 KEY `document_type_id` (`document_type_id`),
478   - KEY `fieldset_id` (`fieldset_id`)
  454 + KEY `fieldset_id` (`fieldset_id`),
  455 + CONSTRAINT `document_type_fieldsets_link_ibfk_1` FOREIGN KEY (`document_type_id`) REFERENCES `document_types_lookup` (`id`) ON DELETE CASCADE,
  456 + CONSTRAINT `document_type_fieldsets_link_ibfk_2` FOREIGN KEY (`fieldset_id`) REFERENCES `fieldsets` (`id`) ON DELETE CASCADE
479 457 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
480 458  
481   --- --------------------------------------------------------
482   -
483   ---
  459 +--
484 460 -- Table structure for table `document_types_lookup`
485   ---
  461 +--
486 462  
487 463 CREATE TABLE `document_types_lookup` (
488 464 `id` int(11) NOT NULL default '0',
... ... @@ -493,11 +469,9 @@ CREATE TABLE `document_types_lookup` (
493 469 KEY `disabled` (`disabled`)
494 470 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
495 471  
496   --- --------------------------------------------------------
497   -
498   ---
  472 +--
499 473 -- Table structure for table `documents`
500   ---
  474 +--
501 475  
502 476 CREATE TABLE `documents` (
503 477 `id` int(11) NOT NULL default '0',
... ... @@ -519,6 +493,7 @@ CREATE TABLE `documents` (
519 493 `immutable` tinyint(1) NOT NULL default '0',
520 494 `restore_folder_id` int(11) default NULL,
521 495 `restore_folder_path` text,
  496 + `checkedout` datetime default NULL,
522 497 UNIQUE KEY `id` (`id`),
523 498 KEY `fk_creator_id` (`creator_id`),
524 499 KEY `fk_folder_id` (`folder_id`),
... ... @@ -531,11 +506,24 @@ CREATE TABLE `documents` (
531 506 KEY `metadata_version_id` (`metadata_version_id`)
532 507 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
533 508  
534   --- --------------------------------------------------------
  509 +--
  510 +-- Table structure for table `download_files`
  511 +--
  512 +
  513 +CREATE TABLE `download_files` (
  514 + `document_id` int(10) unsigned NOT NULL,
  515 + `session` varchar(100) NOT NULL,
  516 + `download_date` timestamp NULL default CURRENT_TIMESTAMP,
  517 + `downloaded` int(10) unsigned NOT NULL default '0',
  518 + `filesize` int(10) unsigned NOT NULL,
  519 + `content_version` int(10) unsigned NOT NULL,
  520 + `hash` varchar(100) NOT NULL,
  521 + PRIMARY KEY (`document_id`,`session`)
  522 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
535 523  
536   ---
  524 +--
537 525 -- Table structure for table `field_behaviour_options`
538   ---
  526 +--
539 527  
540 528 CREATE TABLE `field_behaviour_options` (
541 529 `behaviour_id` int(11) NOT NULL default '0',
... ... @@ -543,14 +531,15 @@ CREATE TABLE `field_behaviour_options` (
543 531 `instance_id` int(11) NOT NULL default '0',
544 532 KEY `behaviour_id` (`behaviour_id`),
545 533 KEY `field_id` (`field_id`),
546   - KEY `instance_id` (`instance_id`)
  534 + KEY `instance_id` (`instance_id`),
  535 + CONSTRAINT `field_behaviour_options_ibfk_1` FOREIGN KEY (`behaviour_id`) REFERENCES `field_behaviours` (`id`) ON DELETE CASCADE,
  536 + CONSTRAINT `field_behaviour_options_ibfk_2` FOREIGN KEY (`field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
  537 + CONSTRAINT `field_behaviour_options_ibfk_3` FOREIGN KEY (`instance_id`) REFERENCES `field_value_instances` (`id`) ON DELETE CASCADE
547 538 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
548 539  
549   --- --------------------------------------------------------
550   -
551   ---
  540 +--
552 541 -- Table structure for table `field_behaviours`
553   ---
  542 +--
554 543  
555 544 CREATE TABLE `field_behaviours` (
556 545 `id` int(11) NOT NULL default '0',
... ... @@ -559,14 +548,13 @@ CREATE TABLE `field_behaviours` (
559 548 `field_id` int(11) NOT NULL default '0',
560 549 PRIMARY KEY (`id`),
561 550 KEY `field_id` (`field_id`),
562   - KEY `name` (`name`)
  551 + KEY `name` (`name`),
  552 + CONSTRAINT `field_behaviours_ibfk_1` FOREIGN KEY (`field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE
563 553 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
564 554  
565   --- --------------------------------------------------------
566   -
567   ---
  555 +--
568 556 -- Table structure for table `field_orders`
569   ---
  557 +--
570 558  
571 559 CREATE TABLE `field_orders` (
572 560 `parent_field_id` int(11) NOT NULL default '0',
... ... @@ -574,14 +562,15 @@ CREATE TABLE `field_orders` (
574 562 `fieldset_id` int(11) NOT NULL default '0',
575 563 UNIQUE KEY `child_field` (`child_field_id`),
576 564 KEY `parent_field` (`parent_field_id`),
577   - KEY `fieldset_id` (`fieldset_id`)
  565 + KEY `fieldset_id` (`fieldset_id`),
  566 + CONSTRAINT `field_orders_ibfk_1` FOREIGN KEY (`parent_field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
  567 + CONSTRAINT `field_orders_ibfk_2` FOREIGN KEY (`child_field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
  568 + CONSTRAINT `field_orders_ibfk_3` FOREIGN KEY (`fieldset_id`) REFERENCES `fieldsets` (`id`) ON DELETE CASCADE
578 569 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
579 570  
580   --- --------------------------------------------------------
581   -
582   ---
  571 +--
583 572 -- Table structure for table `field_value_instances`
584   ---
  573 +--
585 574  
586 575 CREATE TABLE `field_value_instances` (
587 576 `id` int(11) NOT NULL default '0',
... ... @@ -591,14 +580,15 @@ CREATE TABLE `field_value_instances` (
591 580 PRIMARY KEY (`id`),
592 581 KEY `field_id` (`field_id`),
593 582 KEY `field_value_id` (`field_value_id`),
594   - KEY `behaviour_id` (`behaviour_id`)
  583 + KEY `behaviour_id` (`behaviour_id`),
  584 + CONSTRAINT `field_value_instances_ibfk_1` FOREIGN KEY (`field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
  585 + CONSTRAINT `field_value_instances_ibfk_2` FOREIGN KEY (`field_value_id`) REFERENCES `metadata_lookup` (`id`) ON DELETE CASCADE,
  586 + CONSTRAINT `field_value_instances_ibfk_3` FOREIGN KEY (`behaviour_id`) REFERENCES `field_behaviours` (`id`) ON DELETE CASCADE
595 587 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
596 588  
597   --- --------------------------------------------------------
598   -
599   ---
  589 +--
600 590 -- Table structure for table `fieldsets`
601   ---
  591 +--
602 592  
603 593 CREATE TABLE `fieldsets` (
604 594 `id` int(11) NOT NULL default '0',
... ... @@ -612,18 +602,18 @@ CREATE TABLE `fieldsets` (
612 602 `is_complete` tinyint(1) NOT NULL default '1',
613 603 `is_system` tinyint(1) unsigned NOT NULL default '0',
614 604 `description` mediumtext NOT NULL,
  605 + `disabled` tinyint(4) NOT NULL default '0',
615 606 UNIQUE KEY `id` (`id`),
616 607 KEY `is_generic` (`is_generic`),
617 608 KEY `is_complete` (`is_complete`),
618 609 KEY `is_system` (`is_system`),
619   - KEY `master_field` (`master_field`)
  610 + KEY `master_field` (`master_field`),
  611 + CONSTRAINT `fieldsets_ibfk_1` FOREIGN KEY (`master_field`) REFERENCES `document_fields` (`id`) ON DELETE SET NULL
620 612 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
621 613  
622   --- --------------------------------------------------------
623   -
624   ---
  614 +--
625 615 -- Table structure for table `folder_doctypes_link`
626   ---
  616 +--
627 617  
628 618 CREATE TABLE `folder_doctypes_link` (
629 619 `id` int(11) NOT NULL default '0',
... ... @@ -634,11 +624,9 @@ CREATE TABLE `folder_doctypes_link` (
634 624 KEY `fk_document_type_id` (`document_type_id`)
635 625 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
636 626  
637   --- --------------------------------------------------------
638   -
639   ---
  627 +--
640 628 -- Table structure for table `folder_searchable_text`
641   ---
  629 +--
642 630  
643 631 CREATE TABLE `folder_searchable_text` (
644 632 `folder_id` int(11) NOT NULL default '0',
... ... @@ -648,11 +636,9 @@ CREATE TABLE `folder_searchable_text` (
648 636 FULLTEXT KEY `folder_text` (`folder_text`)
649 637 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
650 638  
651   --- --------------------------------------------------------
652   -
653   ---
  639 +--
654 640 -- Table structure for table `folder_subscriptions`
655   ---
  641 +--
656 642  
657 643 CREATE TABLE `folder_subscriptions` (
658 644 `id` int(11) NOT NULL default '0',
... ... @@ -662,11 +648,9 @@ CREATE TABLE `folder_subscriptions` (
662 648 UNIQUE KEY `id` (`id`)
663 649 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
664 650  
665   --- --------------------------------------------------------
666   -
667   ---
  651 +--
668 652 -- Table structure for table `folder_transactions`
669   ---
  653 +--
670 654  
671 655 CREATE TABLE `folder_transactions` (
672 656 `id` int(11) NOT NULL default '0',
... ... @@ -681,14 +665,14 @@ CREATE TABLE `folder_transactions` (
681 665 UNIQUE KEY `id` (`id`),
682 666 KEY `folder_id` (`folder_id`),
683 667 KEY `user_id` (`user_id`),
684   - KEY `session_id` (`session_id`)
  668 + KEY `session_id` (`session_id`),
  669 + CONSTRAINT `folder_transactions_ibfk_1` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`id`) ON DELETE CASCADE,
  670 + CONSTRAINT `folder_transactions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
685 671 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
686 672  
687   --- --------------------------------------------------------
688   -
689   ---
  673 +--
690 674 -- Table structure for table `folder_workflow_map`
691   ---
  675 +--
692 676  
693 677 CREATE TABLE `folder_workflow_map` (
694 678 `folder_id` int(11) NOT NULL default '0',
... ... @@ -697,11 +681,9 @@ CREATE TABLE `folder_workflow_map` (
697 681 UNIQUE KEY `folder_id` (`folder_id`)
698 682 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
699 683  
700   --- --------------------------------------------------------
701   -
702   ---
  684 +--
703 685 -- Table structure for table `folders`
704   ---
  686 +--
705 687  
706 688 CREATE TABLE `folders` (
707 689 `id` int(11) NOT NULL default '0',
... ... @@ -723,11 +705,9 @@ CREATE TABLE `folders` (
723 705 KEY `permission_lookup_id` (`permission_lookup_id`)
724 706 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
725 707  
726   --- --------------------------------------------------------
727   -
728   ---
  708 +--
729 709 -- Table structure for table `folders_users_roles_link`
730   ---
  710 +--
731 711  
732 712 CREATE TABLE `folders_users_roles_link` (
733 713 `id` int(11) NOT NULL default '0',
... ... @@ -741,11 +721,9 @@ CREATE TABLE `folders_users_roles_link` (
741 721 UNIQUE KEY `id` (`id`)
742 722 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
743 723  
744   --- --------------------------------------------------------
745   -
746   ---
  724 +--
747 725 -- Table structure for table `groups_groups_link`
748   ---
  726 +--
749 727  
750 728 CREATE TABLE `groups_groups_link` (
751 729 `id` int(11) NOT NULL default '0',
... ... @@ -753,14 +731,14 @@ CREATE TABLE `groups_groups_link` (
753 731 `member_group_id` int(11) NOT NULL default '0',
754 732 PRIMARY KEY (`id`),
755 733 KEY `groups_groups_link_ibfk_1` (`parent_group_id`),
756   - KEY `groups_groups_link_ibfk_2` (`member_group_id`)
  734 + KEY `groups_groups_link_ibfk_2` (`member_group_id`),
  735 + CONSTRAINT `groups_groups_link_ibfk_1` FOREIGN KEY (`parent_group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE,
  736 + CONSTRAINT `groups_groups_link_ibfk_2` FOREIGN KEY (`member_group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE
757 737 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
758 738  
759   --- --------------------------------------------------------
760   -
761   ---
  739 +--
762 740 -- Table structure for table `groups_lookup`
763   ---
  741 +--
764 742  
765 743 CREATE TABLE `groups_lookup` (
766 744 `id` int(11) NOT NULL default '0',
... ... @@ -775,14 +753,13 @@ CREATE TABLE `groups_lookup` (
775 753 UNIQUE KEY `name` (`name`),
776 754 KEY `unit_id` (`unit_id`),
777 755 KEY `authentication_details_s1` (`authentication_details_s1`),
778   - KEY `authentication_source_id` (`authentication_source_id`)
  756 + KEY `authentication_source_id` (`authentication_source_id`),
  757 + CONSTRAINT `groups_lookup_ibfk_1` FOREIGN KEY (`unit_id`) REFERENCES `units_lookup` (`id`)
779 758 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
780 759  
781   --- --------------------------------------------------------
782   -
783   ---
  760 +--
784 761 -- Table structure for table `help`
785   ---
  762 +--
786 763  
787 764 CREATE TABLE `help` (
788 765 `id` int(11) NOT NULL default '0',
... ... @@ -791,11 +768,9 @@ CREATE TABLE `help` (
791 768 UNIQUE KEY `id` (`id`)
792 769 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
793 770  
794   --- --------------------------------------------------------
795   -
796   ---
  771 +--
797 772 -- Table structure for table `help_replacement`
798   ---
  773 +--
799 774  
800 775 CREATE TABLE `help_replacement` (
801 776 `id` int(11) NOT NULL default '0',
... ... @@ -805,11 +780,22 @@ CREATE TABLE `help_replacement` (
805 780 PRIMARY KEY (`id`)
806 781 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
807 782  
808   --- --------------------------------------------------------
  783 +--
  784 +-- Table structure for table `index_files`
  785 +--
  786 +
  787 +CREATE TABLE `index_files` (
  788 + `document_id` int(10) unsigned NOT NULL,
  789 + `user_id` int(10) unsigned NOT NULL,
  790 + `indexdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  791 + `processdate` datetime default NULL,
  792 + `what` char(1) default NULL,
  793 + PRIMARY KEY (`document_id`)
  794 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
809 795  
810   ---
  796 +--
811 797 -- Table structure for table `interceptor_instances`
812   ---
  798 +--
813 799  
814 800 CREATE TABLE `interceptor_instances` (
815 801 `id` int(11) NOT NULL,
... ... @@ -820,11 +806,9 @@ CREATE TABLE `interceptor_instances` (
820 806 KEY `interceptor_namespace` (`interceptor_namespace`)
821 807 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
822 808  
823   --- --------------------------------------------------------
824   -
825   ---
  809 +--
826 810 -- Table structure for table `links`
827   ---
  811 +--
828 812  
829 813 CREATE TABLE `links` (
830 814 `id` int(11) NOT NULL default '0',
... ... @@ -834,11 +818,9 @@ CREATE TABLE `links` (
834 818 UNIQUE KEY `id` (`id`)
835 819 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
836 820  
837   --- --------------------------------------------------------
838   -
839   ---
  821 +--
840 822 -- Table structure for table `metadata_lookup`
841   ---
  823 +--
842 824  
843 825 CREATE TABLE `metadata_lookup` (
844 826 `id` int(11) NOT NULL default '0',
... ... @@ -852,11 +834,9 @@ CREATE TABLE `metadata_lookup` (
852 834 KEY `is_stuck` (`is_stuck`)
853 835 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
854 836  
855   --- --------------------------------------------------------
856   -
857   ---
  837 +--
858 838 -- Table structure for table `metadata_lookup_tree`
859   ---
  839 +--
860 840  
861 841 CREATE TABLE `metadata_lookup_tree` (
862 842 `id` int(11) NOT NULL default '0',
... ... @@ -868,11 +848,20 @@ CREATE TABLE `metadata_lookup_tree` (
868 848 KEY `document_field_id` (`document_field_id`)
869 849 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
870 850  
871   --- --------------------------------------------------------
  851 +--
  852 +-- Table structure for table `mime_documents`
  853 +--
  854 +
  855 +CREATE TABLE `mime_documents` (
  856 + `id` int(11) NOT NULL,
  857 + `mime_doc` varchar(100) default NULL,
  858 + `icon_path` varchar(20) default NULL,
  859 + PRIMARY KEY (`id`)
  860 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
872 861  
873   ---
  862 +--
874 863 -- Table structure for table `mime_types`
875   ---
  864 +--
876 865  
877 866 CREATE TABLE `mime_types` (
878 867 `id` int(11) NOT NULL default '0',
... ... @@ -880,14 +869,14 @@ CREATE TABLE `mime_types` (
880 869 `mimetypes` char(100) NOT NULL default '',
881 870 `icon_path` char(255) default NULL,
882 871 `friendly_name` char(255) default '',
  872 + `extractor` varchar(100) default NULL,
  873 + `mime_document_id` int(11) default NULL,
883 874 UNIQUE KEY `id` (`id`)
884 875 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
885 876  
886   --- --------------------------------------------------------
887   -
888   ---
  877 +--
889 878 -- Table structure for table `news`
890   ---
  879 +--
891 880  
892 881 CREATE TABLE `news` (
893 882 `id` int(11) NOT NULL default '0',
... ... @@ -901,11 +890,9 @@ CREATE TABLE `news` (
901 890 UNIQUE KEY `id` (`id`)
902 891 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
903 892  
904   --- --------------------------------------------------------
905   -
906   ---
  893 +--
907 894 -- Table structure for table `notifications`
908   ---
  895 +--
909 896  
910 897 CREATE TABLE `notifications` (
911 898 `id` int(11) NOT NULL default '0',
... ... @@ -923,11 +910,9 @@ CREATE TABLE `notifications` (
923 910 KEY `user_id` (`user_id`)
924 911 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
925 912  
926   --- --------------------------------------------------------
927   -
928   ---
  913 +--
929 914 -- Table structure for table `organisations_lookup`
930   ---
  915 +--
931 916  
932 917 CREATE TABLE `organisations_lookup` (
933 918 `id` int(11) NOT NULL default '0',
... ... @@ -936,11 +921,9 @@ CREATE TABLE `organisations_lookup` (
936 921 UNIQUE KEY `name` (`name`)
937 922 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
938 923  
939   --- --------------------------------------------------------
940   -
941   ---
  924 +--
942 925 -- Table structure for table `permission_assignments`
943   ---
  926 +--
944 927  
945 928 CREATE TABLE `permission_assignments` (
946 929 `id` int(11) NOT NULL default '0',
... ... @@ -951,56 +934,57 @@ CREATE TABLE `permission_assignments` (
951 934 UNIQUE KEY `permission_and_object` (`permission_id`,`permission_object_id`),
952 935 KEY `permission_id` (`permission_id`),
953 936 KEY `permission_object_id` (`permission_object_id`),
954   - KEY `permission_descriptor_id` (`permission_descriptor_id`)
  937 + KEY `permission_descriptor_id` (`permission_descriptor_id`),
  938 + CONSTRAINT `permission_assignments_ibfk_1` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  939 + CONSTRAINT `permission_assignments_ibfk_2` FOREIGN KEY (`permission_object_id`) REFERENCES `permission_objects` (`id`) ON DELETE CASCADE,
  940 + CONSTRAINT `permission_assignments_ibfk_3` FOREIGN KEY (`permission_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE
955 941 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
956 942  
957   --- --------------------------------------------------------
958   -
959   ---
  943 +--
960 944 -- Table structure for table `permission_descriptor_groups`
961   ---
  945 +--
962 946  
963 947 CREATE TABLE `permission_descriptor_groups` (
964 948 `descriptor_id` int(11) NOT NULL default '0',
965 949 `group_id` int(11) NOT NULL default '0',
966 950 UNIQUE KEY `descriptor_id` (`descriptor_id`,`group_id`),
967 951 KEY `descriptor_id_2` (`descriptor_id`),
968   - KEY `group_id` (`group_id`)
  952 + KEY `group_id` (`group_id`),
  953 + CONSTRAINT `permission_descriptor_groups_ibfk_1` FOREIGN KEY (`descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE,
  954 + CONSTRAINT `permission_descriptor_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE
969 955 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
970 956  
971   --- --------------------------------------------------------
972   -
973   ---
  957 +--
974 958 -- Table structure for table `permission_descriptor_roles`
975   ---
  959 +--
976 960  
977 961 CREATE TABLE `permission_descriptor_roles` (
978 962 `descriptor_id` int(11) NOT NULL default '0',
979 963 `role_id` int(11) NOT NULL default '0',
980 964 UNIQUE KEY `descriptor_id` (`descriptor_id`,`role_id`),
981 965 KEY `descriptor_id_2` (`descriptor_id`),
982   - KEY `role_id` (`role_id`)
  966 + KEY `role_id` (`role_id`),
  967 + CONSTRAINT `permission_descriptor_roles_ibfk_1` FOREIGN KEY (`descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE,
  968 + CONSTRAINT `permission_descriptor_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
983 969 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
984 970  
985   --- --------------------------------------------------------
986   -
987   ---
  971 +--
988 972 -- Table structure for table `permission_descriptor_users`
989   ---
  973 +--
990 974  
991 975 CREATE TABLE `permission_descriptor_users` (
992 976 `descriptor_id` int(11) NOT NULL default '0',
993 977 `user_id` int(11) NOT NULL default '0',
994 978 UNIQUE KEY `descriptor_id` (`descriptor_id`,`user_id`),
995 979 KEY `descriptor_id_2` (`descriptor_id`),
996   - KEY `user_id` (`user_id`)
  980 + KEY `user_id` (`user_id`),
  981 + CONSTRAINT `permission_descriptor_users_ibfk_1` FOREIGN KEY (`descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE,
  982 + CONSTRAINT `permission_descriptor_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
997 983 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
998 984  
999   --- --------------------------------------------------------
1000   -
1001   ---
  985 +--
1002 986 -- Table structure for table `permission_descriptors`
1003   ---
  987 +--
1004 988  
1005 989 CREATE TABLE `permission_descriptors` (
1006 990 `id` int(11) NOT NULL default '0',
... ... @@ -1011,24 +995,22 @@ CREATE TABLE `permission_descriptors` (
1011 995 KEY `descriptor` (`descriptor`)
1012 996 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1013 997  
1014   --- --------------------------------------------------------
1015   -
1016   ---
  998 +--
1017 999 -- Table structure for table `permission_dynamic_assignments`
1018   ---
  1000 +--
1019 1001  
1020 1002 CREATE TABLE `permission_dynamic_assignments` (
1021 1003 `dynamic_condition_id` int(11) NOT NULL default '0',
1022 1004 `permission_id` int(11) NOT NULL default '0',
1023 1005 KEY `dynamic_conditiond_id` (`dynamic_condition_id`),
1024   - KEY `permission_id` (`permission_id`)
  1006 + KEY `permission_id` (`permission_id`),
  1007 + CONSTRAINT `permission_dynamic_assignments_ibfk_2` FOREIGN KEY (`dynamic_condition_id`) REFERENCES `permission_dynamic_conditions` (`id`) ON DELETE CASCADE,
  1008 + CONSTRAINT `permission_dynamic_assignments_ibfk_3` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
1025 1009 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1026 1010  
1027   --- --------------------------------------------------------
1028   -
1029   ---
  1011 +--
1030 1012 -- Table structure for table `permission_dynamic_conditions`
1031   ---
  1013 +--
1032 1014  
1033 1015 CREATE TABLE `permission_dynamic_conditions` (
1034 1016 `id` int(11) NOT NULL default '0',
... ... @@ -1038,14 +1020,15 @@ CREATE TABLE `permission_dynamic_conditions` (
1038 1020 PRIMARY KEY (`id`),
1039 1021 KEY `permission_object_id` (`permission_object_id`),
1040 1022 KEY `group_id` (`group_id`),
1041   - KEY `condition_id` (`condition_id`)
  1023 + KEY `condition_id` (`condition_id`),
  1024 + CONSTRAINT `permission_dynamic_conditions_ibfk_1` FOREIGN KEY (`permission_object_id`) REFERENCES `permission_objects` (`id`) ON DELETE CASCADE,
  1025 + CONSTRAINT `permission_dynamic_conditions_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE,
  1026 + CONSTRAINT `permission_dynamic_conditions_ibfk_3` FOREIGN KEY (`condition_id`) REFERENCES `saved_searches` (`id`) ON DELETE CASCADE
1042 1027 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1043 1028  
1044   --- --------------------------------------------------------
1045   -
1046   ---
  1029 +--
1047 1030 -- Table structure for table `permission_lookup_assignments`
1048   ---
  1031 +--
1049 1032  
1050 1033 CREATE TABLE `permission_lookup_assignments` (
1051 1034 `id` int(11) NOT NULL default '0',
... ... @@ -1056,36 +1039,33 @@ CREATE TABLE `permission_lookup_assignments` (
1056 1039 UNIQUE KEY `permission_and_lookup` (`permission_id`,`permission_lookup_id`),
1057 1040 KEY `permission_id` (`permission_id`),
1058 1041 KEY `permission_lookup_id` (`permission_lookup_id`),
1059   - KEY `permission_descriptor_id` (`permission_descriptor_id`)
  1042 + KEY `permission_descriptor_id` (`permission_descriptor_id`),
  1043 + CONSTRAINT `permission_lookup_assignments_ibfk_1` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  1044 + CONSTRAINT `permission_lookup_assignments_ibfk_2` FOREIGN KEY (`permission_lookup_id`) REFERENCES `permission_lookups` (`id`) ON DELETE CASCADE,
  1045 + CONSTRAINT `permission_lookup_assignments_ibfk_3` FOREIGN KEY (`permission_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE
1060 1046 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1061 1047  
1062   --- --------------------------------------------------------
1063   -
1064   ---
  1048 +--
1065 1049 -- Table structure for table `permission_lookups`
1066   ---
  1050 +--
1067 1051  
1068 1052 CREATE TABLE `permission_lookups` (
1069 1053 `id` int(11) NOT NULL default '0',
1070 1054 PRIMARY KEY (`id`)
1071 1055 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1072 1056  
1073   --- --------------------------------------------------------
1074   -
1075   ---
  1057 +--
1076 1058 -- Table structure for table `permission_objects`
1077   ---
  1059 +--
1078 1060  
1079 1061 CREATE TABLE `permission_objects` (
1080 1062 `id` int(11) NOT NULL default '0',
1081 1063 PRIMARY KEY (`id`)
1082 1064 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1083 1065  
1084   --- --------------------------------------------------------
1085   -
1086   ---
  1066 +--
1087 1067 -- Table structure for table `permissions`
1088   ---
  1068 +--
1089 1069  
1090 1070 CREATE TABLE `permissions` (
1091 1071 `id` int(11) NOT NULL default '0',
... ... @@ -1096,11 +1076,21 @@ CREATE TABLE `permissions` (
1096 1076 UNIQUE KEY `name` (`name`)
1097 1077 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1098 1078  
1099   --- --------------------------------------------------------
  1079 +--
  1080 +-- Table structure for table `plugin_rss`
  1081 +--
1100 1082  
1101   ---
  1083 +CREATE TABLE `plugin_rss` (
  1084 + `id` int(11) NOT NULL,
  1085 + `user_id` int(11) NOT NULL,
  1086 + `url` varchar(200) NOT NULL,
  1087 + `title` varchar(20) NOT NULL,
  1088 + PRIMARY KEY (`id`)
  1089 +) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  1090 +
  1091 +--
1102 1092 -- Table structure for table `plugins`
1103   ---
  1093 +--
1104 1094  
1105 1095 CREATE TABLE `plugins` (
1106 1096 `id` int(11) NOT NULL default '0',
... ... @@ -1115,11 +1105,9 @@ CREATE TABLE `plugins` (
1115 1105 KEY `name` (`namespace`)
1116 1106 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1117 1107  
1118   --- --------------------------------------------------------
1119   -
1120   ---
  1108 +--
1121 1109 -- Table structure for table `role_allocations`
1122   ---
  1110 +--
1123 1111  
1124 1112 CREATE TABLE `role_allocations` (
1125 1113 `id` int(11) NOT NULL default '0',
... ... @@ -1130,11 +1118,9 @@ CREATE TABLE `role_allocations` (
1130 1118 KEY `folder_id` (`folder_id`)
1131 1119 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1132 1120  
1133   --- --------------------------------------------------------
1134   -
1135   ---
  1121 +--
1136 1122 -- Table structure for table `roles`
1137   ---
  1123 +--
1138 1124  
1139 1125 CREATE TABLE `roles` (
1140 1126 `id` int(11) NOT NULL default '0',
... ... @@ -1143,11 +1129,9 @@ CREATE TABLE `roles` (
1143 1129 UNIQUE KEY `name` (`name`)
1144 1130 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1145 1131  
1146   --- --------------------------------------------------------
1147   -
1148   ---
  1132 +--
1149 1133 -- Table structure for table `saved_searches`
1150   ---
  1134 +--
1151 1135  
1152 1136 CREATE TABLE `saved_searches` (
1153 1137 `id` int(11) NOT NULL default '0',
... ... @@ -1161,34 +1145,31 @@ CREATE TABLE `saved_searches` (
1161 1145 KEY `namespace` (`namespace`),
1162 1146 KEY `is_condition` (`is_condition`),
1163 1147 KEY `is_complete` (`is_complete`),
1164   - KEY `user_id` (`user_id`)
  1148 + KEY `user_id` (`user_id`),
  1149 + CONSTRAINT `saved_searches_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1165 1150 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1166 1151  
1167   --- --------------------------------------------------------
1168   -
1169   ---
  1152 +--
1170 1153 -- Table structure for table `scheduler_tasks`
1171   ---
  1154 +--
1172 1155  
1173 1156 CREATE TABLE `scheduler_tasks` (
1174 1157 `id` int(11) NOT NULL default '0',
1175   - `task` varchar(50),
1176   - `script_url` varchar(255),
1177   - `script_params` varchar(255),
1178   - `on_completion` varchar(255),
  1158 + `task` varchar(50) default NULL,
  1159 + `script_url` varchar(255) default NULL,
  1160 + `script_params` varchar(255) default NULL,
  1161 + `on_completion` varchar(255) default NULL,
1179 1162 `is_background` tinyint(4) NOT NULL default '0',
1180 1163 `is_complete` tinyint(4) NOT NULL default '0',
1181   - `frequency` varchar(25),
1182   - `run_time` int(11),
1183   - `previous_run_time` int(11),
1184   - `run_duration` float
  1164 + `frequency` varchar(25) default NULL,
  1165 + `run_time` int(11) default NULL,
  1166 + `previous_run_time` int(11) default NULL,
  1167 + `run_duration` float default NULL
1185 1168 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1186 1169  
1187   --- --------------------------------------------------------
1188   -
1189   ---
  1170 +--
1190 1171 -- Table structure for table `search_document_user_link`
1191   ---
  1172 +--
1192 1173  
1193 1174 CREATE TABLE `search_document_user_link` (
1194 1175 `document_id` int(11) default NULL,
... ... @@ -1197,11 +1178,43 @@ CREATE TABLE `search_document_user_link` (
1197 1178 KEY `fk_document_ids` (`document_id`)
1198 1179 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1199 1180  
1200   --- --------------------------------------------------------
  1181 +--
  1182 +-- Table structure for table `search_ranking`
  1183 +--
1201 1184  
1202   ---
  1185 +CREATE TABLE `search_ranking` (
  1186 + `groupname` varchar(100) NOT NULL,
  1187 + `itemname` varchar(100) NOT NULL,
  1188 + `ranking` float default '0',
  1189 + `type` enum('T','M','S') default 'T' COMMENT 'T=Table, M=Metadata, S=Searchable',
  1190 + PRIMARY KEY (`groupname`,`itemname`)
  1191 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1192 +
  1193 +--
  1194 +-- Table structure for table `search_saved`
  1195 +--
  1196 +
  1197 +CREATE TABLE `search_saved` (
  1198 + `id` int(11) NOT NULL,
  1199 + `name` varchar(100) NOT NULL,
  1200 + `expression` tinytext NOT NULL,
  1201 + `user_id` int(11) NOT NULL,
  1202 + `type` enum('S','C','W','B') NOT NULL default 'S' COMMENT 'S=saved search, C=permission, w=workflow, B=subscription',
  1203 + `shared` tinyint(4) NOT NULL default '0',
  1204 + PRIMARY KEY (`id`)
  1205 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1206 +
  1207 +--
  1208 +-- Table structure for table `search_saved_events`
  1209 +--
  1210 +
  1211 +CREATE TABLE `search_saved_events` (
  1212 + `document_id` int(11) NOT NULL
  1213 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1214 +
  1215 +--
1203 1216 -- Table structure for table `status_lookup`
1204   ---
  1217 +--
1205 1218  
1206 1219 CREATE TABLE `status_lookup` (
1207 1220 `id` int(11) NOT NULL default '0',
... ... @@ -1209,24 +1222,30 @@ CREATE TABLE `status_lookup` (
1209 1222 UNIQUE KEY `id` (`id`)
1210 1223 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1211 1224  
1212   --- --------------------------------------------------------
1213   -
1214   ---
  1225 +--
1215 1226 -- Table structure for table `system_settings`
1216   ---
  1227 +--
1217 1228  
1218 1229 CREATE TABLE `system_settings` (
1219 1230 `id` int(11) NOT NULL default '0',
1220 1231 `name` char(255) NOT NULL default '',
1221   - `value` text NOT NULL default '',
  1232 + `value` text NOT NULL,
1222 1233 UNIQUE KEY `id` (`id`)
1223 1234 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1224 1235  
1225   --- --------------------------------------------------------
  1236 +--
  1237 +-- Table structure for table `tag_words`
  1238 +--
  1239 +
  1240 +CREATE TABLE `tag_words` (
  1241 + `id` int(10) NOT NULL,
  1242 + `tag` varchar(100) default NULL,
  1243 + PRIMARY KEY (`id`)
  1244 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1226 1245  
1227   ---
  1246 +--
1228 1247 -- Table structure for table `time_period`
1229   ---
  1248 +--
1230 1249  
1231 1250 CREATE TABLE `time_period` (
1232 1251 `id` int(11) NOT NULL default '0',
... ... @@ -1235,11 +1254,9 @@ CREATE TABLE `time_period` (
1235 1254 UNIQUE KEY `id` (`id`)
1236 1255 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1237 1256  
1238   --- --------------------------------------------------------
1239   -
1240   ---
  1257 +--
1241 1258 -- Table structure for table `time_unit_lookup`
1242   ---
  1259 +--
1243 1260  
1244 1261 CREATE TABLE `time_unit_lookup` (
1245 1262 `id` int(11) NOT NULL default '0',
... ... @@ -1247,11 +1264,9 @@ CREATE TABLE `time_unit_lookup` (
1247 1264 UNIQUE KEY `id` (`id`)
1248 1265 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1249 1266  
1250   --- --------------------------------------------------------
1251   -
1252   ---
  1267 +--
1253 1268 -- Table structure for table `trigger_selection`
1254   ---
  1269 +--
1255 1270  
1256 1271 CREATE TABLE `trigger_selection` (
1257 1272 `event_ns` varchar(255) NOT NULL default '',
... ... @@ -1260,11 +1275,9 @@ CREATE TABLE `trigger_selection` (
1260 1275 UNIQUE KEY `event_ns` (`event_ns`)
1261 1276 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1262 1277  
1263   --- --------------------------------------------------------
1264   -
1265   ---
  1278 +--
1266 1279 -- Table structure for table `type_workflow_map`
1267   ---
  1280 +--
1268 1281  
1269 1282 CREATE TABLE `type_workflow_map` (
1270 1283 `document_type_id` int(11) NOT NULL default '0',
... ... @@ -1273,11 +1286,9 @@ CREATE TABLE `type_workflow_map` (
1273 1286 UNIQUE KEY `document_type_id` (`document_type_id`)
1274 1287 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1275 1288  
1276   --- --------------------------------------------------------
1277   -
1278   ---
  1289 +--
1279 1290 -- Table structure for table `units_lookup`
1280   ---
  1291 +--
1281 1292  
1282 1293 CREATE TABLE `units_lookup` (
1283 1294 `id` int(11) NOT NULL default '0',
... ... @@ -1288,11 +1299,9 @@ CREATE TABLE `units_lookup` (
1288 1299 UNIQUE KEY `folder_id` (`folder_id`)
1289 1300 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1290 1301  
1291   --- --------------------------------------------------------
1292   -
1293   ---
  1302 +--
1294 1303 -- Table structure for table `units_organisations_link`
1295   ---
  1304 +--
1296 1305  
1297 1306 CREATE TABLE `units_organisations_link` (
1298 1307 `id` int(11) NOT NULL default '0',
... ... @@ -1303,11 +1312,9 @@ CREATE TABLE `units_organisations_link` (
1303 1312 KEY `fk_organisation_id` (`organisation_id`)
1304 1313 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1305 1314  
1306   --- --------------------------------------------------------
1307   -
1308   ---
  1315 +--
1309 1316 -- Table structure for table `upgrades`
1310   ---
  1317 +--
1311 1318  
1312 1319 CREATE TABLE `upgrades` (
1313 1320 `id` int(10) unsigned NOT NULL default '0',
... ... @@ -1321,11 +1328,22 @@ CREATE TABLE `upgrades` (
1321 1328 KEY `parent` (`parent`)
1322 1329 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1323 1330  
1324   --- --------------------------------------------------------
  1331 +--
  1332 +-- Table structure for table `uploaded_files`
  1333 +--
1325 1334  
1326   ---
  1335 +CREATE TABLE `uploaded_files` (
  1336 + `tempfilename` varchar(100) NOT NULL,
  1337 + `filename` varchar(100) NOT NULL,
  1338 + `userid` int(11) NOT NULL,
  1339 + `uploaddate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  1340 + `action` char(1) NOT NULL COMMENT 'A = Add, C = Checkin',
  1341 + `document_id` int(11) default NULL
  1342 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1343 +
  1344 +--
1327 1345 -- Table structure for table `user_history`
1328   ---
  1346 +--
1329 1347  
1330 1348 CREATE TABLE `user_history` (
1331 1349 `id` int(11) NOT NULL,
... ... @@ -1338,14 +1356,13 @@ CREATE TABLE `user_history` (
1338 1356 KEY `user_id` (`user_id`),
1339 1357 KEY `action_namespace` (`action_namespace`),
1340 1358 KEY `datetime` (`datetime`),
1341   - KEY `session_id` (`session_id`)
  1359 + KEY `session_id` (`session_id`),
  1360 + CONSTRAINT `user_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
1342 1361 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1343 1362  
1344   --- --------------------------------------------------------
1345   -
1346   ---
  1363 +--
1347 1364 -- Table structure for table `users`
1348   ---
  1365 +--
1349 1366  
1350 1367 CREATE TABLE `users` (
1351 1368 `id` int(11) NOT NULL default '0',
... ... @@ -1377,14 +1394,13 @@ CREATE TABLE `users` (
1377 1394 KEY `authentication_details_b1` (`authentication_details_b1`),
1378 1395 KEY `authentication_details_b2` (`authentication_details_b2`),
1379 1396 KEY `last_login` (`last_login`),
1380   - KEY `disabled` (`disabled`)
  1397 + KEY `disabled` (`disabled`),
  1398 + CONSTRAINT `users_ibfk_1` FOREIGN KEY (`authentication_source_id`) REFERENCES `authentication_sources` (`id`) ON DELETE SET NULL
1381 1399 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1382 1400  
1383   --- --------------------------------------------------------
1384   -
1385   ---
  1401 +--
1386 1402 -- Table structure for table `users_groups_link`
1387   ---
  1403 +--
1388 1404  
1389 1405 CREATE TABLE `users_groups_link` (
1390 1406 `id` int(11) NOT NULL default '0',
... ... @@ -1392,14 +1408,14 @@ CREATE TABLE `users_groups_link` (
1392 1408 `group_id` int(11) NOT NULL default '0',
1393 1409 UNIQUE KEY `id` (`id`),
1394 1410 KEY `fk_user_id` (`user_id`),
1395   - KEY `fk_group_id` (`group_id`)
  1411 + KEY `fk_group_id` (`group_id`),
  1412 + CONSTRAINT `users_groups_link_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE,
  1413 + CONSTRAINT `users_groups_link_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
1396 1414 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1397 1415  
1398   --- --------------------------------------------------------
1399   -
1400   ---
  1416 +--
1401 1417 -- Table structure for table `workflow_actions`
1402   ---
  1418 +--
1403 1419  
1404 1420 CREATE TABLE `workflow_actions` (
1405 1421 `workflow_id` int(11) NOT NULL default '0',
... ... @@ -1408,11 +1424,9 @@ CREATE TABLE `workflow_actions` (
1408 1424 KEY `action_name` (`action_name`)
1409 1425 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1410 1426  
1411   --- --------------------------------------------------------
1412   -
1413   ---
  1427 +--
1414 1428 -- Table structure for table `workflow_documents`
1415   ---
  1429 +--
1416 1430  
1417 1431 CREATE TABLE `workflow_documents` (
1418 1432 `document_id` int(11) NOT NULL default '0',
... ... @@ -1423,11 +1437,9 @@ CREATE TABLE `workflow_documents` (
1423 1437 KEY `state_id` (`state_id`)
1424 1438 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1425 1439  
1426   --- --------------------------------------------------------
1427   -
1428   ---
  1440 +--
1429 1441 -- Table structure for table `workflow_state_actions`
1430   ---
  1442 +--
1431 1443  
1432 1444 CREATE TABLE `workflow_state_actions` (
1433 1445 `state_id` int(11) NOT NULL default '0',
... ... @@ -1436,11 +1448,9 @@ CREATE TABLE `workflow_state_actions` (
1436 1448 KEY `action_name` (`action_name`)
1437 1449 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1438 1450  
1439   --- --------------------------------------------------------
1440   -
1441   ---
  1451 +--
1442 1452 -- Table structure for table `workflow_state_disabled_actions`
1443   ---
  1453 +--
1444 1454  
1445 1455 CREATE TABLE `workflow_state_disabled_actions` (
1446 1456 `state_id` int(11) NOT NULL default '0',
... ... @@ -1449,11 +1459,9 @@ CREATE TABLE `workflow_state_disabled_actions` (
1449 1459 KEY `action_name` (`action_name`)
1450 1460 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1451 1461  
1452   --- --------------------------------------------------------
1453   -
1454   ---
  1462 +--
1455 1463 -- Table structure for table `workflow_state_permission_assignments`
1456   ---
  1464 +--
1457 1465  
1458 1466 CREATE TABLE `workflow_state_permission_assignments` (
1459 1467 `id` int(11) NOT NULL default '0',
... ... @@ -1463,25 +1471,23 @@ CREATE TABLE `workflow_state_permission_assignments` (
1463 1471 PRIMARY KEY (`id`),
1464 1472 KEY `permission_id` (`permission_id`),
1465 1473 KEY `permission_descriptor_id` (`permission_descriptor_id`),
1466   - KEY `workflow_state_id` (`workflow_state_id`)
  1474 + KEY `workflow_state_id` (`workflow_state_id`),
  1475 + CONSTRAINT `workflow_state_permission_assignments_ibfk_7` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  1476 + CONSTRAINT `workflow_state_permission_assignments_ibfk_8` FOREIGN KEY (`permission_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE
1467 1477 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1468 1478  
1469   --- --------------------------------------------------------
1470   -
1471   ---
  1479 +--
1472 1480 -- Table structure for table `workflow_state_transitions`
1473   ---
  1481 +--
1474 1482  
1475 1483 CREATE TABLE `workflow_state_transitions` (
1476 1484 `state_id` int(11) NOT NULL default '0',
1477 1485 `transition_id` int(11) NOT NULL default '0'
1478 1486 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1479 1487  
1480   --- --------------------------------------------------------
1481   -
1482   ---
  1488 +--
1483 1489 -- Table structure for table `workflow_states`
1484   ---
  1490 +--
1485 1491  
1486 1492 CREATE TABLE `workflow_states` (
1487 1493 `id` int(11) NOT NULL default '0',
... ... @@ -1494,14 +1500,14 @@ CREATE TABLE `workflow_states` (
1494 1500 PRIMARY KEY (`id`),
1495 1501 KEY `workflow_id` (`workflow_id`),
1496 1502 KEY `name` (`name`),
1497   - KEY `inform_descriptor_id` (`inform_descriptor_id`)
  1503 + KEY `inform_descriptor_id` (`inform_descriptor_id`),
  1504 + CONSTRAINT `workflow_states_ibfk_1` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`),
  1505 + CONSTRAINT `workflow_states_ibfk_2` FOREIGN KEY (`inform_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE SET NULL
1498 1506 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1499 1507  
1500   --- --------------------------------------------------------
1501   -
1502   ---
  1508 +--
1503 1509 -- Table structure for table `workflow_transitions`
1504   ---
  1510 +--
1505 1511  
1506 1512 CREATE TABLE `workflow_transitions` (
1507 1513 `id` int(11) NOT NULL default '0',
... ... @@ -1521,14 +1527,18 @@ CREATE TABLE `workflow_transitions` (
1521 1527 KEY `guard_permission_id` (`guard_permission_id`),
1522 1528 KEY `guard_condition` (`guard_condition_id`),
1523 1529 KEY `guard_group_id` (`guard_group_id`),
1524   - KEY `guard_role_id` (`guard_role_id`)
  1530 + KEY `guard_role_id` (`guard_role_id`),
  1531 + CONSTRAINT `workflow_transitions_ibfk_45` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE,
  1532 + CONSTRAINT `workflow_transitions_ibfk_46` FOREIGN KEY (`target_state_id`) REFERENCES `workflow_states` (`id`) ON DELETE CASCADE,
  1533 + CONSTRAINT `workflow_transitions_ibfk_47` FOREIGN KEY (`guard_permission_id`) REFERENCES `permissions` (`id`) ON DELETE SET NULL,
  1534 + CONSTRAINT `workflow_transitions_ibfk_48` FOREIGN KEY (`guard_group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE SET NULL,
  1535 + CONSTRAINT `workflow_transitions_ibfk_49` FOREIGN KEY (`guard_role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
  1536 + CONSTRAINT `workflow_transitions_ibfk_50` FOREIGN KEY (`guard_condition_id`) REFERENCES `saved_searches` (`id`) ON DELETE SET NULL
1525 1537 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1526 1538  
1527   --- --------------------------------------------------------
1528   -
1529   ---
  1539 +--
1530 1540 -- Table structure for table `workflow_trigger_instances`
1531   ---
  1541 +--
1532 1542  
1533 1543 CREATE TABLE `workflow_trigger_instances` (
1534 1544 `id` int(10) unsigned NOT NULL default '0',
... ... @@ -1540,11 +1550,9 @@ CREATE TABLE `workflow_trigger_instances` (
1540 1550 KEY `namespace` (`namespace`)
1541 1551 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
1542 1552  
1543   --- --------------------------------------------------------
1544   -
1545   ---
  1553 +--
1546 1554 -- Table structure for table `workflows`
1547   ---
  1555 +--
1548 1556  
1549 1557 CREATE TABLE `workflows` (
1550 1558 `id` int(11) NOT NULL default '0',
... ... @@ -1554,1110 +1562,744 @@ CREATE TABLE `workflows` (
1554 1562 `enabled` int(1) unsigned NOT NULL default '1',
1555 1563 PRIMARY KEY (`id`),
1556 1564 UNIQUE KEY `name` (`name`),
1557   - KEY `start_state_id` (`start_state_id`)
  1565 + KEY `start_state_id` (`start_state_id`),
  1566 + CONSTRAINT `workflows_ibfk_1` FOREIGN KEY (`start_state_id`) REFERENCES `workflow_states` (`id`)
1558 1567 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1559 1568  
1560   --- --------------------------------------------------------
1561   -
1562   ---
  1569 +--
1563 1570 -- Table structure for table `zseq_active_sessions`
1564   ---
  1571 +--
1565 1572  
1566 1573 CREATE TABLE `zseq_active_sessions` (
1567 1574 `id` int(10) unsigned NOT NULL auto_increment,
1568 1575 PRIMARY KEY (`id`)
1569   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1570   -
1571   --- --------------------------------------------------------
  1576 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1572 1577  
1573   ---
  1578 +--
1574 1579 -- Table structure for table `zseq_archive_restoration_request`
1575   ---
  1580 +--
1576 1581  
1577 1582 CREATE TABLE `zseq_archive_restoration_request` (
1578 1583 `id` int(10) unsigned NOT NULL auto_increment,
1579 1584 PRIMARY KEY (`id`)
1580   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1585 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1581 1586  
1582   --- --------------------------------------------------------
1583   -
1584   ---
  1587 +--
1585 1588 -- Table structure for table `zseq_archiving_settings`
1586   ---
  1589 +--
1587 1590  
1588 1591 CREATE TABLE `zseq_archiving_settings` (
1589 1592 `id` int(10) unsigned NOT NULL auto_increment,
1590 1593 PRIMARY KEY (`id`)
1591   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1592   -
1593   --- --------------------------------------------------------
  1594 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1594 1595  
1595   ---
  1596 +--
1596 1597 -- Table structure for table `zseq_archiving_type_lookup`
1597   ---
  1598 +--
1598 1599  
1599 1600 CREATE TABLE `zseq_archiving_type_lookup` (
1600 1601 `id` int(10) unsigned NOT NULL auto_increment,
1601 1602 PRIMARY KEY (`id`)
1602   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  1603 +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
1603 1604  
1604   --- --------------------------------------------------------
1605   -
1606   ---
  1605 +--
1607 1606 -- Table structure for table `zseq_authentication_sources`
1608   ---
  1607 +--
1609 1608  
1610 1609 CREATE TABLE `zseq_authentication_sources` (
1611 1610 `id` int(10) unsigned NOT NULL auto_increment,
1612 1611 PRIMARY KEY (`id`)
1613   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1614   -
1615   --- --------------------------------------------------------
  1612 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1616 1613  
1617   ---
  1614 +--
1618 1615 -- Table structure for table `zseq_browse_criteria`
1619   ---
  1616 +--
1620 1617  
1621 1618 CREATE TABLE `zseq_browse_criteria` (
1622 1619 `id` int(10) unsigned NOT NULL auto_increment,
1623 1620 PRIMARY KEY (`id`)
1624   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
  1621 +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
1625 1622  
1626   --- --------------------------------------------------------
1627   -
1628   ---
  1623 +--
1629 1624 -- Table structure for table `zseq_column_entries`
1630   ---
  1625 +--
1631 1626  
1632 1627 CREATE TABLE `zseq_column_entries` (
1633 1628 `id` int(10) unsigned NOT NULL auto_increment,
1634 1629 PRIMARY KEY (`id`)
1635   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
1636   -
1637   --- --------------------------------------------------------
  1630 +) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
1638 1631  
1639   ---
  1632 +--
1640 1633 -- Table structure for table `zseq_dashlet_disables`
1641   ---
  1634 +--
1642 1635  
1643 1636 CREATE TABLE `zseq_dashlet_disables` (
1644 1637 `id` int(10) unsigned NOT NULL auto_increment,
1645 1638 PRIMARY KEY (`id`)
1646   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1639 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1647 1640  
1648   --- --------------------------------------------------------
1649   -
1650   ---
  1641 +--
1651 1642 -- Table structure for table `zseq_data_types`
1652   ---
  1643 +--
1653 1644  
1654 1645 CREATE TABLE `zseq_data_types` (
1655 1646 `id` int(10) unsigned NOT NULL auto_increment,
1656 1647 PRIMARY KEY (`id`)
1657   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
1658   -
1659   --- --------------------------------------------------------
  1648 +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
1660 1649  
1661   ---
  1650 +--
1662 1651 -- Table structure for table `zseq_dependant_document_instance`
1663   ---
  1652 +--
1664 1653  
1665 1654 CREATE TABLE `zseq_dependant_document_instance` (
1666 1655 `id` int(10) unsigned NOT NULL auto_increment,
1667 1656 PRIMARY KEY (`id`)
1668   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1657 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1669 1658  
1670   --- --------------------------------------------------------
1671   -
1672   ---
  1659 +--
1673 1660 -- Table structure for table `zseq_dependant_document_template`
1674   ---
  1661 +--
1675 1662  
1676 1663 CREATE TABLE `zseq_dependant_document_template` (
1677 1664 `id` int(10) unsigned NOT NULL auto_increment,
1678 1665 PRIMARY KEY (`id`)
1679   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1680   -
1681   --- --------------------------------------------------------
  1666 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1682 1667  
1683   ---
  1668 +--
1684 1669 -- Table structure for table `zseq_discussion_comments`
1685   ---
  1670 +--
1686 1671  
1687 1672 CREATE TABLE `zseq_discussion_comments` (
1688 1673 `id` int(10) unsigned NOT NULL auto_increment,
1689 1674 PRIMARY KEY (`id`)
1690   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1675 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1691 1676  
1692   --- --------------------------------------------------------
1693   -
1694   ---
  1677 +--
1695 1678 -- Table structure for table `zseq_discussion_threads`
1696   ---
  1679 +--
1697 1680  
1698 1681 CREATE TABLE `zseq_discussion_threads` (
1699 1682 `id` int(10) unsigned NOT NULL auto_increment,
1700 1683 PRIMARY KEY (`id`)
1701   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1702   -
1703   --- --------------------------------------------------------
  1684 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1704 1685  
1705   ---
  1686 +--
1706 1687 -- Table structure for table `zseq_document_archiving_link`
1707   ---
  1688 +--
1708 1689  
1709 1690 CREATE TABLE `zseq_document_archiving_link` (
1710 1691 `id` int(10) unsigned NOT NULL auto_increment,
1711 1692 PRIMARY KEY (`id`)
1712   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1693 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1713 1694  
1714   --- --------------------------------------------------------
1715   -
1716   ---
  1695 +--
1717 1696 -- Table structure for table `zseq_document_content_version`
1718   ---
  1697 +--
1719 1698  
1720 1699 CREATE TABLE `zseq_document_content_version` (
1721 1700 `id` int(10) unsigned NOT NULL auto_increment,
1722 1701 PRIMARY KEY (`id`)
1723   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1724   -
1725   --- --------------------------------------------------------
  1702 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1726 1703  
1727   ---
  1704 +--
1728 1705 -- Table structure for table `zseq_document_fields`
1729   ---
  1706 +--
1730 1707  
1731 1708 CREATE TABLE `zseq_document_fields` (
1732 1709 `id` int(10) unsigned NOT NULL auto_increment,
1733 1710 PRIMARY KEY (`id`)
1734   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1711 +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
1735 1712  
1736   --- --------------------------------------------------------
1737   -
1738   ---
  1713 +--
1739 1714 -- Table structure for table `zseq_document_fields_link`
1740   ---
  1715 +--
1741 1716  
1742 1717 CREATE TABLE `zseq_document_fields_link` (
1743 1718 `id` int(10) unsigned NOT NULL auto_increment,
1744 1719 PRIMARY KEY (`id`)
1745   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1746   -
1747   --- --------------------------------------------------------
  1720 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1748 1721  
1749   ---
  1722 +--
1750 1723 -- Table structure for table `zseq_document_link`
1751   ---
  1724 +--
1752 1725  
1753 1726 CREATE TABLE `zseq_document_link` (
1754 1727 `id` int(10) unsigned NOT NULL auto_increment,
1755 1728 PRIMARY KEY (`id`)
1756   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1729 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1757 1730  
1758   --- --------------------------------------------------------
1759   -
1760   ---
  1731 +--
1761 1732 -- Table structure for table `zseq_document_link_types`
1762   ---
  1733 +--
1763 1734  
1764 1735 CREATE TABLE `zseq_document_link_types` (
1765 1736 `id` int(10) unsigned NOT NULL auto_increment,
1766 1737 PRIMARY KEY (`id`)
1767   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
1768   -
1769   --- --------------------------------------------------------
  1738 +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
1770 1739  
1771   ---
  1740 +--
1772 1741 -- Table structure for table `zseq_document_metadata_version`
1773   ---
  1742 +--
1774 1743  
1775 1744 CREATE TABLE `zseq_document_metadata_version` (
1776 1745 `id` int(10) unsigned NOT NULL auto_increment,
1777 1746 PRIMARY KEY (`id`)
1778   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1747 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1779 1748  
1780   --- --------------------------------------------------------
1781   -
1782   ---
  1749 +--
1783 1750 -- Table structure for table `zseq_document_role_allocations`
1784   ---
  1751 +--
1785 1752  
1786 1753 CREATE TABLE `zseq_document_role_allocations` (
1787 1754 `id` int(10) unsigned NOT NULL auto_increment,
1788 1755 PRIMARY KEY (`id`)
1789   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1790   -
1791   --- --------------------------------------------------------
  1756 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1792 1757  
1793   ---
  1758 +--
1794 1759 -- Table structure for table `zseq_document_subscriptions`
1795   ---
  1760 +--
1796 1761  
1797 1762 CREATE TABLE `zseq_document_subscriptions` (
1798 1763 `id` int(10) unsigned NOT NULL auto_increment,
1799 1764 PRIMARY KEY (`id`)
1800   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1765 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  1766 +
  1767 +--
  1768 +-- Table structure for table `zseq_document_tags`
  1769 +--
1801 1770  
1802   --- --------------------------------------------------------
  1771 +CREATE TABLE `zseq_document_tags` (
  1772 + `id` int(10) NOT NULL auto_increment,
  1773 + PRIMARY KEY (`id`)
  1774 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1803 1775  
1804   ---
  1776 +--
1805 1777 -- Table structure for table `zseq_document_transaction_types_lookup`
1806   ---
  1778 +--
1807 1779  
1808 1780 CREATE TABLE `zseq_document_transaction_types_lookup` (
1809 1781 `id` int(10) unsigned NOT NULL auto_increment,
1810 1782 PRIMARY KEY (`id`)
1811   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
1812   -
1813   --- --------------------------------------------------------
  1783 +) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
1814 1784  
1815   ---
  1785 +--
1816 1786 -- Table structure for table `zseq_document_transactions`
1817   ---
  1787 +--
1818 1788  
1819 1789 CREATE TABLE `zseq_document_transactions` (
1820 1790 `id` int(10) unsigned NOT NULL auto_increment,
1821 1791 PRIMARY KEY (`id`)
1822   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1792 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1823 1793  
1824   --- --------------------------------------------------------
1825   -
1826   ---
  1794 +--
1827 1795 -- Table structure for table `zseq_document_type_fields_link`
1828   ---
  1796 +--
1829 1797  
1830 1798 CREATE TABLE `zseq_document_type_fields_link` (
1831 1799 `id` int(10) unsigned NOT NULL auto_increment,
1832 1800 PRIMARY KEY (`id`)
1833   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1834   -
1835   --- --------------------------------------------------------
  1801 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1836 1802  
1837   ---
  1803 +--
1838 1804 -- Table structure for table `zseq_document_type_fieldsets_link`
1839   ---
  1805 +--
1840 1806  
1841 1807 CREATE TABLE `zseq_document_type_fieldsets_link` (
1842 1808 `id` int(10) unsigned NOT NULL auto_increment,
1843 1809 PRIMARY KEY (`id`)
1844   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1810 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1845 1811  
1846   --- --------------------------------------------------------
1847   -
1848   ---
  1812 +--
1849 1813 -- Table structure for table `zseq_document_types_lookup`
1850   ---
  1814 +--
1851 1815  
1852 1816 CREATE TABLE `zseq_document_types_lookup` (
1853 1817 `id` int(10) unsigned NOT NULL auto_increment,
1854 1818 PRIMARY KEY (`id`)
1855   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1856   -
1857   --- --------------------------------------------------------
  1819 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1858 1820  
1859   ---
  1821 +--
1860 1822 -- Table structure for table `zseq_documents`
1861   ---
  1823 +--
1862 1824  
1863 1825 CREATE TABLE `zseq_documents` (
1864 1826 `id` int(10) unsigned NOT NULL auto_increment,
1865 1827 PRIMARY KEY (`id`)
1866   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1828 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1867 1829  
1868   --- --------------------------------------------------------
1869   -
1870   ---
  1830 +--
1871 1831 -- Table structure for table `zseq_field_behaviours`
1872   ---
  1832 +--
1873 1833  
1874 1834 CREATE TABLE `zseq_field_behaviours` (
1875 1835 `id` int(10) unsigned NOT NULL auto_increment,
1876 1836 PRIMARY KEY (`id`)
1877   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1878   -
1879   --- --------------------------------------------------------
  1837 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1880 1838  
1881   ---
  1839 +--
1882 1840 -- Table structure for table `zseq_field_value_instances`
1883   ---
  1841 +--
1884 1842  
1885 1843 CREATE TABLE `zseq_field_value_instances` (
1886 1844 `id` int(10) unsigned NOT NULL auto_increment,
1887 1845 PRIMARY KEY (`id`)
1888   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1846 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1889 1847  
1890   --- --------------------------------------------------------
1891   -
1892   ---
  1848 +--
1893 1849 -- Table structure for table `zseq_fieldsets`
1894   ---
  1850 +--
1895 1851  
1896 1852 CREATE TABLE `zseq_fieldsets` (
1897 1853 `id` int(10) unsigned NOT NULL auto_increment,
1898 1854 PRIMARY KEY (`id`)
1899   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1900   -
1901   --- --------------------------------------------------------
  1855 +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
1902 1856  
1903   ---
  1857 +--
1904 1858 -- Table structure for table `zseq_folder_doctypes_link`
1905   ---
  1859 +--
1906 1860  
1907 1861 CREATE TABLE `zseq_folder_doctypes_link` (
1908 1862 `id` int(10) unsigned NOT NULL auto_increment,
1909 1863 PRIMARY KEY (`id`)
1910   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  1864 +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
1911 1865  
1912   --- --------------------------------------------------------
1913   -
1914   ---
  1866 +--
1915 1867 -- Table structure for table `zseq_folder_subscriptions`
1916   ---
  1868 +--
1917 1869  
1918 1870 CREATE TABLE `zseq_folder_subscriptions` (
1919 1871 `id` int(10) unsigned NOT NULL auto_increment,
1920 1872 PRIMARY KEY (`id`)
1921   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1922   -
1923   --- --------------------------------------------------------
  1873 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1924 1874  
1925   ---
  1875 +--
1926 1876 -- Table structure for table `zseq_folder_transactions`
1927   ---
  1877 +--
1928 1878  
1929 1879 CREATE TABLE `zseq_folder_transactions` (
1930 1880 `id` int(10) unsigned NOT NULL auto_increment,
1931 1881 PRIMARY KEY (`id`)
1932   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  1882 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1933 1883  
1934   --- --------------------------------------------------------
1935   -
1936   ---
  1884 +--
1937 1885 -- Table structure for table `zseq_folders`
1938   ---
  1886 +--
1939 1887  
1940 1888 CREATE TABLE `zseq_folders` (
1941 1889 `id` int(10) unsigned NOT NULL auto_increment,
1942 1890 PRIMARY KEY (`id`)
1943   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
1944   -
1945   --- --------------------------------------------------------
  1891 +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
1946 1892  
1947   ---
  1893 +--
1948 1894 -- Table structure for table `zseq_folders_users_roles_link`
1949   ---
  1895 +--
1950 1896  
1951 1897 CREATE TABLE `zseq_folders_users_roles_link` (
1952 1898 `id` int(10) unsigned NOT NULL auto_increment,
1953 1899 PRIMARY KEY (`id`)
1954   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1900 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1955 1901  
1956   --- --------------------------------------------------------
1957   -
1958   ---
  1902 +--
1959 1903 -- Table structure for table `zseq_groups_groups_link`
1960   ---
  1904 +--
1961 1905  
1962 1906 CREATE TABLE `zseq_groups_groups_link` (
1963 1907 `id` int(10) unsigned NOT NULL auto_increment,
1964 1908 PRIMARY KEY (`id`)
1965   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1966   -
1967   --- --------------------------------------------------------
  1909 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1968 1910  
1969   ---
  1911 +--
1970 1912 -- Table structure for table `zseq_groups_lookup`
1971   ---
  1913 +--
1972 1914  
1973 1915 CREATE TABLE `zseq_groups_lookup` (
1974 1916 `id` int(10) unsigned NOT NULL auto_increment,
1975 1917 PRIMARY KEY (`id`)
1976   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
  1918 +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
1977 1919  
1978   --- --------------------------------------------------------
1979   -
1980   ---
  1920 +--
1981 1921 -- Table structure for table `zseq_help`
1982   ---
  1922 +--
1983 1923  
1984 1924 CREATE TABLE `zseq_help` (
1985 1925 `id` int(10) unsigned NOT NULL auto_increment,
1986 1926 PRIMARY KEY (`id`)
1987   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=99 ;
1988   -
1989   --- --------------------------------------------------------
  1927 +) ENGINE=MyISAM AUTO_INCREMENT=99 DEFAULT CHARSET=latin1;
1990 1928  
1991   ---
  1929 +--
1992 1930 -- Table structure for table `zseq_help_replacement`
1993   ---
  1931 +--
1994 1932  
1995 1933 CREATE TABLE `zseq_help_replacement` (
1996 1934 `id` int(10) unsigned NOT NULL auto_increment,
1997 1935 PRIMARY KEY (`id`)
1998   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1936 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
1999 1937  
2000   --- --------------------------------------------------------
2001   -
2002   ---
  1938 +--
2003 1939 -- Table structure for table `zseq_interceptor_instances`
2004   ---
  1940 +--
2005 1941  
2006 1942 CREATE TABLE `zseq_interceptor_instances` (
2007 1943 `id` int(10) unsigned NOT NULL auto_increment,
2008 1944 PRIMARY KEY (`id`)
2009   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
2010   -
2011   --- --------------------------------------------------------
  1945 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
2012 1946  
2013   ---
  1947 +--
2014 1948 -- Table structure for table `zseq_links`
2015   ---
  1949 +--
2016 1950  
2017 1951 CREATE TABLE `zseq_links` (
2018 1952 `id` int(10) unsigned NOT NULL auto_increment,
2019 1953 PRIMARY KEY (`id`)
2020   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1954 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2021 1955  
2022   --- --------------------------------------------------------
2023   -
2024   ---
  1956 +--
2025 1957 -- Table structure for table `zseq_metadata_lookup`
2026   ---
  1958 +--
2027 1959  
2028 1960 CREATE TABLE `zseq_metadata_lookup` (
2029 1961 `id` int(10) unsigned NOT NULL auto_increment,
2030 1962 PRIMARY KEY (`id`)
2031   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2032   -
2033   --- --------------------------------------------------------
  1963 +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
2034 1964  
2035   ---
  1965 +--
2036 1966 -- Table structure for table `zseq_metadata_lookup_tree`
2037   ---
  1967 +--
2038 1968  
2039 1969 CREATE TABLE `zseq_metadata_lookup_tree` (
2040 1970 `id` int(10) unsigned NOT NULL auto_increment,
2041 1971 PRIMARY KEY (`id`)
2042   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  1972 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2043 1973  
2044   --- --------------------------------------------------------
  1974 +--
  1975 +-- Table structure for table `zseq_mime_documents`
  1976 +--
2045 1977  
2046   ---
  1978 +CREATE TABLE `zseq_mime_documents` (
  1979 + `id` int(11) default NULL
  1980 +) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  1981 +
  1982 +--
2047 1983 -- Table structure for table `zseq_mime_types`
2048   ---
  1984 +--
2049 1985  
2050 1986 CREATE TABLE `zseq_mime_types` (
2051 1987 `id` int(10) unsigned NOT NULL auto_increment,
2052 1988 PRIMARY KEY (`id`)
2053   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=162 ;
  1989 +) ENGINE=MyISAM AUTO_INCREMENT=162 DEFAULT CHARSET=latin1;
2054 1990  
2055   --- --------------------------------------------------------
2056   -
2057   ---
  1991 +--
2058 1992 -- Table structure for table `zseq_news`
2059   ---
  1993 +--
2060 1994  
2061 1995 CREATE TABLE `zseq_news` (
2062 1996 `id` int(10) unsigned NOT NULL auto_increment,
2063 1997 PRIMARY KEY (`id`)
2064   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2065   -
2066   --- --------------------------------------------------------
  1998 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2067 1999  
2068   ---
  2000 +--
2069 2001 -- Table structure for table `zseq_notifications`
2070   ---
  2002 +--
2071 2003  
2072 2004 CREATE TABLE `zseq_notifications` (
2073 2005 `id` int(10) unsigned NOT NULL auto_increment,
2074 2006 PRIMARY KEY (`id`)
2075   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2076   -
2077   --- --------------------------------------------------------
  2007 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2078 2008  
2079   ---
  2009 +--
2080 2010 -- Table structure for table `zseq_organisations_lookup`
2081   ---
  2011 +--
2082 2012  
2083 2013 CREATE TABLE `zseq_organisations_lookup` (
2084 2014 `id` int(10) unsigned NOT NULL auto_increment,
2085 2015 PRIMARY KEY (`id`)
2086   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  2016 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2087 2017  
2088   --- --------------------------------------------------------
2089   -
2090   ---
  2018 +--
2091 2019 -- Table structure for table `zseq_permission_assignments`
2092   ---
  2020 +--
2093 2021  
2094 2022 CREATE TABLE `zseq_permission_assignments` (
2095 2023 `id` int(10) unsigned NOT NULL auto_increment,
2096 2024 PRIMARY KEY (`id`)
2097   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
2098   -
2099   --- --------------------------------------------------------
  2025 +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
2100 2026  
2101   ---
  2027 +--
2102 2028 -- Table structure for table `zseq_permission_descriptors`
2103   ---
  2029 +--
2104 2030  
2105 2031 CREATE TABLE `zseq_permission_descriptors` (
2106 2032 `id` int(10) unsigned NOT NULL auto_increment,
2107 2033 PRIMARY KEY (`id`)
2108   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  2034 +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
2109 2035  
2110   --- --------------------------------------------------------
2111   -
2112   ---
  2036 +--
2113 2037 -- Table structure for table `zseq_permission_dynamic_conditions`
2114   ---
  2038 +--
2115 2039  
2116 2040 CREATE TABLE `zseq_permission_dynamic_conditions` (
2117 2041 `id` int(10) unsigned NOT NULL auto_increment,
2118 2042 PRIMARY KEY (`id`)
2119   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2120   -
2121   --- --------------------------------------------------------
  2043 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2122 2044  
2123   ---
  2045 +--
2124 2046 -- Table structure for table `zseq_permission_lookup_assignments`
2125   ---
  2047 +--
2126 2048  
2127 2049 CREATE TABLE `zseq_permission_lookup_assignments` (
2128 2050 `id` int(10) unsigned NOT NULL auto_increment,
2129 2051 PRIMARY KEY (`id`)
2130   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ;
  2052 +) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
2131 2053  
2132   --- --------------------------------------------------------
2133   -
2134   ---
  2054 +--
2135 2055 -- Table structure for table `zseq_permission_lookups`
2136   ---
  2056 +--
2137 2057  
2138 2058 CREATE TABLE `zseq_permission_lookups` (
2139 2059 `id` int(10) unsigned NOT NULL auto_increment,
2140 2060 PRIMARY KEY (`id`)
2141   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
2142   -
2143   --- --------------------------------------------------------
  2061 +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
2144 2062  
2145   ---
  2063 +--
2146 2064 -- Table structure for table `zseq_permission_objects`
2147   ---
  2065 +--
2148 2066  
2149 2067 CREATE TABLE `zseq_permission_objects` (
2150 2068 `id` int(10) unsigned NOT NULL auto_increment,
2151 2069 PRIMARY KEY (`id`)
2152   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  2070 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2153 2071  
2154   --- --------------------------------------------------------
2155   -
2156   ---
  2072 +--
2157 2073 -- Table structure for table `zseq_permissions`
2158   ---
  2074 +--
2159 2075  
2160 2076 CREATE TABLE `zseq_permissions` (
2161 2077 `id` int(10) unsigned NOT NULL auto_increment,
2162 2078 PRIMARY KEY (`id`)
2163   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
  2079 +) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
2164 2080  
2165   --- --------------------------------------------------------
  2081 +--
  2082 +-- Table structure for table `zseq_plugin_rss`
  2083 +--
2166 2084  
2167   ---
  2085 +CREATE TABLE `zseq_plugin_rss` (
  2086 + `id` int(10) unsigned NOT NULL auto_increment,
  2087 + PRIMARY KEY (`id`)
  2088 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  2089 +
  2090 +--
2168 2091 -- Table structure for table `zseq_plugins`
2169   ---
  2092 +--
2170 2093  
2171 2094 CREATE TABLE `zseq_plugins` (
2172 2095 `id` int(10) unsigned NOT NULL auto_increment,
2173 2096 PRIMARY KEY (`id`)
2174   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=49 ;
  2097 +) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=latin1;
2175 2098  
2176   --- --------------------------------------------------------
2177   -
2178   ---
  2099 +--
2179 2100 -- Table structure for table `zseq_role_allocations`
2180   ---
  2101 +--
2181 2102  
2182 2103 CREATE TABLE `zseq_role_allocations` (
2183 2104 `id` int(10) unsigned NOT NULL auto_increment,
2184 2105 PRIMARY KEY (`id`)
2185   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2186   -
2187   --- --------------------------------------------------------
  2106 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2188 2107  
2189   ---
  2108 +--
2190 2109 -- Table structure for table `zseq_roles`
2191   ---
  2110 +--
2192 2111  
2193 2112 CREATE TABLE `zseq_roles` (
2194 2113 `id` int(10) unsigned NOT NULL auto_increment,
2195 2114 PRIMARY KEY (`id`)
2196   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  2115 +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
2197 2116  
2198   --- --------------------------------------------------------
2199   -
2200   ---
  2117 +--
2201 2118 -- Table structure for table `zseq_saved_searches`
2202   ---
  2119 +--
2203 2120  
2204 2121 CREATE TABLE `zseq_saved_searches` (
2205 2122 `id` int(10) unsigned NOT NULL auto_increment,
2206 2123 PRIMARY KEY (`id`)
2207   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2208   -
2209   --- --------------------------------------------------------
  2124 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2210 2125  
2211   ---
2212   --- Table structure for table `zseq_saved_searches`
2213   ---
  2126 +--
  2127 +-- Table structure for table `zseq_scheduler_tasks`
  2128 +--
2214 2129  
2215 2130 CREATE TABLE `zseq_scheduler_tasks` (
2216 2131 `id` int(10) unsigned NOT NULL auto_increment,
2217 2132 PRIMARY KEY (`id`)
2218   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  2133 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  2134 +
  2135 +--
  2136 +-- Table structure for table `zseq_search_saved`
  2137 +--
2219 2138  
2220   --- --------------------------------------------------------
  2139 +CREATE TABLE `zseq_search_saved` (
  2140 + `id` int(11) default NULL
  2141 +) ENGINE=MyISAM DEFAULT CHARSET=utf8;
2221 2142  
2222   ---
  2143 +--
2223 2144 -- Table structure for table `zseq_status_lookup`
2224   ---
  2145 +--
2225 2146  
2226 2147 CREATE TABLE `zseq_status_lookup` (
2227 2148 `id` int(10) unsigned NOT NULL auto_increment,
2228 2149 PRIMARY KEY (`id`)
2229   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
2230   -
2231   --- --------------------------------------------------------
  2150 +) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
2232 2151  
2233   ---
  2152 +--
2234 2153 -- Table structure for table `zseq_system_settings`
2235   ---
  2154 +--
2236 2155  
2237 2156 CREATE TABLE `zseq_system_settings` (
2238 2157 `id` int(10) unsigned NOT NULL auto_increment,
2239 2158 PRIMARY KEY (`id`)
2240   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
  2159 +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
2241 2160  
2242   --- --------------------------------------------------------
  2161 +--
  2162 +-- Table structure for table `zseq_tag_words`
  2163 +--
2243 2164  
2244   ---
  2165 +CREATE TABLE `zseq_tag_words` (
  2166 + `id` int(10) NOT NULL auto_increment,
  2167 + PRIMARY KEY (`id`)
  2168 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  2169 +
  2170 +--
2245 2171 -- Table structure for table `zseq_time_period`
2246   ---
  2172 +--
2247 2173  
2248 2174 CREATE TABLE `zseq_time_period` (
2249 2175 `id` int(10) unsigned NOT NULL auto_increment,
2250 2176 PRIMARY KEY (`id`)
2251   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2252   -
2253   --- --------------------------------------------------------
  2177 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2254 2178  
2255   ---
  2179 +--
2256 2180 -- Table structure for table `zseq_time_unit_lookup`
2257   ---
  2181 +--
2258 2182  
2259 2183 CREATE TABLE `zseq_time_unit_lookup` (
2260 2184 `id` int(10) unsigned NOT NULL auto_increment,
2261 2185 PRIMARY KEY (`id`)
2262   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
  2186 +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
2263 2187  
2264   --- --------------------------------------------------------
2265   -
2266   ---
  2188 +--
2267 2189 -- Table structure for table `zseq_units_lookup`
2268   ---
  2190 +--
2269 2191  
2270 2192 CREATE TABLE `zseq_units_lookup` (
2271 2193 `id` int(10) unsigned NOT NULL auto_increment,
2272 2194 PRIMARY KEY (`id`)
2273   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2274   -
2275   --- --------------------------------------------------------
  2195 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2276 2196  
2277   ---
  2197 +--
2278 2198 -- Table structure for table `zseq_units_organisations_link`
2279   ---
  2199 +--
2280 2200  
2281 2201 CREATE TABLE `zseq_units_organisations_link` (
2282 2202 `id` int(10) unsigned NOT NULL auto_increment,
2283 2203 PRIMARY KEY (`id`)
2284   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  2204 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2285 2205  
2286   --- --------------------------------------------------------
2287   -
2288   ---
  2206 +--
2289 2207 -- Table structure for table `zseq_upgrades`
2290   ---
  2208 +--
2291 2209  
2292 2210 CREATE TABLE `zseq_upgrades` (
2293 2211 `id` int(10) unsigned NOT NULL auto_increment,
2294 2212 PRIMARY KEY (`id`)
2295   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=130 ;
2296   -
2297   --- --------------------------------------------------------
  2213 +) ENGINE=MyISAM AUTO_INCREMENT=145 DEFAULT CHARSET=latin1;
2298 2214  
2299   ---
  2215 +--
2300 2216 -- Table structure for table `zseq_user_history`
2301   ---
  2217 +--
2302 2218  
2303 2219 CREATE TABLE `zseq_user_history` (
2304 2220 `id` int(10) unsigned NOT NULL auto_increment,
2305 2221 PRIMARY KEY (`id`)
2306   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  2222 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
2307 2223  
2308   --- --------------------------------------------------------
2309   -
2310   ---
  2224 +--
2311 2225 -- Table structure for table `zseq_users`
2312   ---
  2226 +--
2313 2227  
2314 2228 CREATE TABLE `zseq_users` (
2315 2229 `id` int(10) unsigned NOT NULL auto_increment,
2316 2230 PRIMARY KEY (`id`)
2317   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
2318   -
2319   --- --------------------------------------------------------
  2231 +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
2320 2232  
2321   ---
  2233 +--
2322 2234 -- Table structure for table `zseq_users_groups_link`
2323   ---
  2235 +--
2324 2236  
2325 2237 CREATE TABLE `zseq_users_groups_link` (
2326 2238 `id` int(10) unsigned NOT NULL auto_increment,
2327 2239 PRIMARY KEY (`id`)
2328   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
2329   -
2330   --- --------------------------------------------------------
  2240 +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
2331 2241  
2332   ---
  2242 +--
2333 2243 -- Table structure for table `zseq_workflow_state_disabled_actions`
2334   ---
  2244 +--
2335 2245  
2336 2246 CREATE TABLE `zseq_workflow_state_disabled_actions` (
2337 2247 `id` int(10) unsigned NOT NULL auto_increment,
2338 2248 PRIMARY KEY (`id`)
2339   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  2249 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
2340 2250  
2341   --- --------------------------------------------------------
2342   -
2343   ---
  2251 +--
2344 2252 -- Table structure for table `zseq_workflow_state_permission_assignments`
2345   ---
  2253 +--
2346 2254  
2347 2255 CREATE TABLE `zseq_workflow_state_permission_assignments` (
2348 2256 `id` int(10) unsigned NOT NULL auto_increment,
2349 2257 PRIMARY KEY (`id`)
2350   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2351   -
2352   --- --------------------------------------------------------
  2258 +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
2353 2259  
2354   ---
  2260 +--
2355 2261 -- Table structure for table `zseq_workflow_states`
2356   ---
  2262 +--
2357 2263  
2358 2264 CREATE TABLE `zseq_workflow_states` (
2359 2265 `id` int(10) unsigned NOT NULL auto_increment,
2360 2266 PRIMARY KEY (`id`)
2361   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  2267 +) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
2362 2268  
2363   --- --------------------------------------------------------
2364   -
2365   ---
  2269 +--
2366 2270 -- Table structure for table `zseq_workflow_transitions`
2367   ---
  2271 +--
2368 2272  
2369 2273 CREATE TABLE `zseq_workflow_transitions` (
2370 2274 `id` int(10) unsigned NOT NULL auto_increment,
2371 2275 PRIMARY KEY (`id`)
2372   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2373   -
2374   --- --------------------------------------------------------
  2276 +) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
2375 2277  
2376   ---
  2278 +--
2377 2279 -- Table structure for table `zseq_workflow_trigger_instances`
2378   ---
  2280 +--
2379 2281  
2380 2282 CREATE TABLE `zseq_workflow_trigger_instances` (
2381 2283 `id` int(10) unsigned NOT NULL auto_increment,
2382 2284 PRIMARY KEY (`id`)
2383   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  2285 +) ENGINE=MyISAM DEFAULT CHARSET=latin1;
2384 2286  
2385   --- --------------------------------------------------------
2386   -
2387   ---
  2287 +--
2388 2288 -- Table structure for table `zseq_workflows`
2389   ---
  2289 +--
2390 2290  
2391 2291 CREATE TABLE `zseq_workflows` (
2392 2292 `id` int(10) unsigned NOT NULL auto_increment,
2393 2293 PRIMARY KEY (`id`)
2394   -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
2395   -
2396   ---
2397   --- Constraints for dumped tables
2398   ---
2399   -
2400   ---
2401   --- Constraints for table `document_fields`
2402   ---
2403   -ALTER TABLE `document_fields`
2404   - ADD CONSTRAINT `document_fields_ibfk_1` FOREIGN KEY (`parent_fieldset`) REFERENCES `fieldsets` (`id`) ON DELETE CASCADE;
2405   -
2406   ---
2407   --- Constraints for table `document_fields_link`
2408   ---
2409   -ALTER TABLE `document_fields_link`
2410   - ADD CONSTRAINT `document_fields_link_ibfk_2` FOREIGN KEY (`document_field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE;
2411   -
2412   ---
2413   --- Constraints for table `document_metadata_version`
2414   ---
2415   -ALTER TABLE `document_metadata_version`
2416   - ADD CONSTRAINT `document_metadata_version_ibfk_4` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE,
2417   - ADD CONSTRAINT `document_metadata_version_ibfk_5` FOREIGN KEY (`document_type_id`) REFERENCES `document_types_lookup` (`id`),
2418   - ADD CONSTRAINT `document_metadata_version_ibfk_6` FOREIGN KEY (`status_id`) REFERENCES `status_lookup` (`id`),
2419   - ADD CONSTRAINT `document_metadata_version_ibfk_7` FOREIGN KEY (`version_creator_id`) REFERENCES `users` (`id`),
2420   - ADD CONSTRAINT `document_metadata_version_ibfk_8` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`),
2421   - ADD CONSTRAINT `document_metadata_version_ibfk_9` FOREIGN KEY (`workflow_state_id`) REFERENCES `workflow_states` (`id`);
2422   -
2423   ---
2424   --- Constraints for table `document_type_fieldsets_link`
2425   ---
2426   -ALTER TABLE `document_type_fieldsets_link`
2427   - ADD CONSTRAINT `document_type_fieldsets_link_ibfk_1` FOREIGN KEY (`document_type_id`) REFERENCES `document_types_lookup` (`id`) ON DELETE CASCADE,
2428   - ADD CONSTRAINT `document_type_fieldsets_link_ibfk_2` FOREIGN KEY (`fieldset_id`) REFERENCES `fieldsets` (`id`) ON DELETE CASCADE;
  2294 +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  2295 +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
2429 2296  
2430   ---
2431   --- Constraints for table `field_behaviour_options`
2432   ---
2433   -ALTER TABLE `field_behaviour_options`
2434   - ADD CONSTRAINT `field_behaviour_options_ibfk_1` FOREIGN KEY (`behaviour_id`) REFERENCES `field_behaviours` (`id`) ON DELETE CASCADE,
2435   - ADD CONSTRAINT `field_behaviour_options_ibfk_2` FOREIGN KEY (`field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
2436   - ADD CONSTRAINT `field_behaviour_options_ibfk_3` FOREIGN KEY (`instance_id`) REFERENCES `field_value_instances` (`id`) ON DELETE CASCADE;
2437   -
2438   ---
2439   --- Constraints for table `field_behaviours`
2440   ---
2441   -ALTER TABLE `field_behaviours`
2442   - ADD CONSTRAINT `field_behaviours_ibfk_1` FOREIGN KEY (`field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE;
2443   -
2444   ---
2445   --- Constraints for table `field_orders`
2446   ---
2447   -ALTER TABLE `field_orders`
2448   - ADD CONSTRAINT `field_orders_ibfk_1` FOREIGN KEY (`parent_field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
2449   - ADD CONSTRAINT `field_orders_ibfk_2` FOREIGN KEY (`child_field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
2450   - ADD CONSTRAINT `field_orders_ibfk_3` FOREIGN KEY (`fieldset_id`) REFERENCES `fieldsets` (`id`) ON DELETE CASCADE;
2451   -
2452   ---
2453   --- Constraints for table `field_value_instances`
2454   ---
2455   -ALTER TABLE `field_value_instances`
2456   - ADD CONSTRAINT `field_value_instances_ibfk_1` FOREIGN KEY (`field_id`) REFERENCES `document_fields` (`id`) ON DELETE CASCADE,
2457   - ADD CONSTRAINT `field_value_instances_ibfk_2` FOREIGN KEY (`field_value_id`) REFERENCES `metadata_lookup` (`id`) ON DELETE CASCADE,
2458   - ADD CONSTRAINT `field_value_instances_ibfk_3` FOREIGN KEY (`behaviour_id`) REFERENCES `field_behaviours` (`id`) ON DELETE CASCADE;
2459   -
2460   ---
2461   --- Constraints for table `fieldsets`
2462   ---
2463   -ALTER TABLE `fieldsets`
2464   - ADD CONSTRAINT `fieldsets_ibfk_1` FOREIGN KEY (`master_field`) REFERENCES `document_fields` (`id`) ON DELETE SET NULL;
2465   -
2466   ---
2467   --- Constraints for table `folder_transactions`
2468   ---
2469   -ALTER TABLE `folder_transactions`
2470   - ADD CONSTRAINT `folder_transactions_ibfk_1` FOREIGN KEY (`folder_id`) REFERENCES `folders` (`id`) ON DELETE CASCADE,
2471   - ADD CONSTRAINT `folder_transactions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
2472   -
2473   ---
2474   --- Constraints for table `groups_groups_link`
2475   ---
2476   -ALTER TABLE `groups_groups_link`
2477   - ADD CONSTRAINT `groups_groups_link_ibfk_1` FOREIGN KEY (`parent_group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE,
2478   - ADD CONSTRAINT `groups_groups_link_ibfk_2` FOREIGN KEY (`member_group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE;
2479   -
2480   ---
2481   --- Constraints for table `groups_lookup`
2482   ---
2483   -ALTER TABLE `groups_lookup`
2484   - ADD CONSTRAINT `groups_lookup_ibfk_1` FOREIGN KEY (`unit_id`) REFERENCES `units_lookup` (`id`);
2485   -
2486   ---
2487   --- Constraints for table `permission_assignments`
2488   ---
2489   -ALTER TABLE `permission_assignments`
2490   - ADD CONSTRAINT `permission_assignments_ibfk_1` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
2491   - ADD CONSTRAINT `permission_assignments_ibfk_2` FOREIGN KEY (`permission_object_id`) REFERENCES `permission_objects` (`id`) ON DELETE CASCADE,
2492   - ADD CONSTRAINT `permission_assignments_ibfk_3` FOREIGN KEY (`permission_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE;
2493   -
2494   ---
2495   --- Constraints for table `permission_descriptor_groups`
2496   ---
2497   -ALTER TABLE `permission_descriptor_groups`
2498   - ADD CONSTRAINT `permission_descriptor_groups_ibfk_1` FOREIGN KEY (`descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE,
2499   - ADD CONSTRAINT `permission_descriptor_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE;
2500   -
2501   ---
2502   --- Constraints for table `permission_descriptor_roles`
2503   ---
2504   -ALTER TABLE `permission_descriptor_roles`
2505   - ADD CONSTRAINT `permission_descriptor_roles_ibfk_1` FOREIGN KEY (`descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE,
2506   - ADD CONSTRAINT `permission_descriptor_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
2507   -
2508   ---
2509   --- Constraints for table `permission_descriptor_users`
2510   ---
2511   -ALTER TABLE `permission_descriptor_users`
2512   - ADD CONSTRAINT `permission_descriptor_users_ibfk_1` FOREIGN KEY (`descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE,
2513   - ADD CONSTRAINT `permission_descriptor_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
2514   -
2515   ---
2516   --- Constraints for table `permission_dynamic_assignments`
2517   ---
2518   -ALTER TABLE `permission_dynamic_assignments`
2519   - ADD CONSTRAINT `permission_dynamic_assignments_ibfk_2` FOREIGN KEY (`dynamic_condition_id`) REFERENCES `permission_dynamic_conditions` (`id`) ON DELETE CASCADE,
2520   - ADD CONSTRAINT `permission_dynamic_assignments_ibfk_3` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;
2521   -
2522   ---
2523   --- Constraints for table `permission_dynamic_conditions`
2524   ---
2525   -ALTER TABLE `permission_dynamic_conditions`
2526   - ADD CONSTRAINT `permission_dynamic_conditions_ibfk_1` FOREIGN KEY (`permission_object_id`) REFERENCES `permission_objects` (`id`) ON DELETE CASCADE,
2527   - ADD CONSTRAINT `permission_dynamic_conditions_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE,
2528   - ADD CONSTRAINT `permission_dynamic_conditions_ibfk_3` FOREIGN KEY (`condition_id`) REFERENCES `saved_searches` (`id`) ON DELETE CASCADE;
2529   -
2530   ---
2531   --- Constraints for table `permission_lookup_assignments`
2532   ---
2533   -ALTER TABLE `permission_lookup_assignments`
2534   - ADD CONSTRAINT `permission_lookup_assignments_ibfk_1` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
2535   - ADD CONSTRAINT `permission_lookup_assignments_ibfk_2` FOREIGN KEY (`permission_lookup_id`) REFERENCES `permission_lookups` (`id`) ON DELETE CASCADE,
2536   - ADD CONSTRAINT `permission_lookup_assignments_ibfk_3` FOREIGN KEY (`permission_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE;
2537   -
2538   ---
2539   --- Constraints for table `saved_searches`
2540   ---
2541   -ALTER TABLE `saved_searches`
2542   - ADD CONSTRAINT `saved_searches_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
2543   -
2544   ---
2545   --- Constraints for table `user_history`
2546   ---
2547   -ALTER TABLE `user_history`
2548   - ADD CONSTRAINT `user_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
2549   -
2550   ---
2551   --- Constraints for table `users`
2552   ---
2553   -ALTER TABLE `users`
2554   - ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`authentication_source_id`) REFERENCES `authentication_sources` (`id`) ON DELETE SET NULL;
2555   -
2556   ---
2557   --- Constraints for table `users_groups_link`
2558   ---
2559   -ALTER TABLE `users_groups_link`
2560   - ADD CONSTRAINT `users_groups_link_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE CASCADE,
2561   - ADD CONSTRAINT `users_groups_link_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
2562   -
2563   ---
2564   --- Constraints for table `workflow_state_permission_assignments`
2565   ---
2566   -ALTER TABLE `workflow_state_permission_assignments`
2567   - ADD CONSTRAINT `workflow_state_permission_assignments_ibfk_7` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
2568   - ADD CONSTRAINT `workflow_state_permission_assignments_ibfk_8` FOREIGN KEY (`permission_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE CASCADE;
2569   -
2570   ---
2571   --- Constraints for table `workflow_states`
2572   ---
2573   -ALTER TABLE `workflow_states`
2574   - ADD CONSTRAINT `workflow_states_ibfk_1` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`),
2575   - ADD CONSTRAINT `workflow_states_ibfk_2` FOREIGN KEY (`inform_descriptor_id`) REFERENCES `permission_descriptors` (`id`) ON DELETE SET NULL;
2576   -
2577   ---
2578   --- Constraints for table `workflow_transitions`
2579   ---
2580   -ALTER TABLE `workflow_transitions`
2581   - ADD CONSTRAINT `workflow_transitions_ibfk_45` FOREIGN KEY (`workflow_id`) REFERENCES `workflows` (`id`) ON DELETE CASCADE,
2582   - ADD CONSTRAINT `workflow_transitions_ibfk_46` FOREIGN KEY (`target_state_id`) REFERENCES `workflow_states` (`id`) ON DELETE CASCADE,
2583   - ADD CONSTRAINT `workflow_transitions_ibfk_47` FOREIGN KEY (`guard_permission_id`) REFERENCES `permissions` (`id`) ON DELETE SET NULL,
2584   - ADD CONSTRAINT `workflow_transitions_ibfk_48` FOREIGN KEY (`guard_group_id`) REFERENCES `groups_lookup` (`id`) ON DELETE SET NULL,
2585   - ADD CONSTRAINT `workflow_transitions_ibfk_49` FOREIGN KEY (`guard_role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
2586   - ADD CONSTRAINT `workflow_transitions_ibfk_50` FOREIGN KEY (`guard_condition_id`) REFERENCES `saved_searches` (`id`) ON DELETE SET NULL;
2587   -
2588   ---
2589   --- Constraints for table `workflows`
2590   ---
2591   -ALTER TABLE `workflows`
2592   - ADD CONSTRAINT `workflows_ibfk_1` FOREIGN KEY (`start_state_id`) REFERENCES `workflow_states` (`id`);
2593   -
2594   -
2595   -CREATE TABLE `plugin_rss`
2596   -( `id` int(11) NOT NULL,
2597   - `user_id` int(11) NOT NULL,
2598   - `url` varchar(200) NOT NULL,
2599   - `title` varchar(20) NOT NULL,
2600   - PRIMARY KEY (`id`))
2601   -ENGINE=MyISAM DEFAULT CHARSET=utf8;
2602   -
2603   -CREATE TABLE `zseq_plugin_rss`
2604   -(
2605   - `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
2606   - PRIMARY KEY (`id`)
2607   -) ENGINE=MyISAM AUTO_INCREMENT=1;
2608   -
2609   -CREATE TABLE `tag_words` (
2610   - `id` int(10) NOT NULL,
2611   - `tag` varchar(100) default NULL,
2612   - PRIMARY KEY (`id`))
2613   -ENGINE=InnoDB DEFAULT CHARSET=utf8;
2614   -
2615   -CREATE TABLE `document_tags` (
2616   - `document_id` int(10) NOT NULL,
2617   - `tag_id` int(10) NOT NULL,
2618   - PRIMARY KEY (`document_id`,`tag_id`),
2619   - CONSTRAINT fk_document_tags_document_id FOREIGN KEY (document_id) REFERENCES documents(id) ON UPDATE CASCADE ON DELETE CASCADE,
2620   - CONSTRAINT fk_document_tags_tag_id FOREIGN KEY (tag_id) REFERENCES tag_words(id) ON UPDATE CASCADE ON DELETE CASCADE
2621   -)
2622   -ENGINE=InnoDB DEFAULT CHARSET=utf8;
2623   -
2624   -CREATE TABLE `zseq_document_tags` (
2625   - `id` int(10) NOT NULL auto_increment,
2626   - PRIMARY KEY (`id`))
2627   -ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
2628   -
2629   -CREATE TABLE `zseq_tag_words` (
2630   - `id` int(10) NOT NULL auto_increment,
2631   - PRIMARY KEY (`id`))
2632   -ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
2633   -
2634   -ALTER TABLE fieldsets ADD disabled tinyint not null default 0;
2635   -
2636   -CREATE TABLE `uploaded_files` (
2637   -`tempfilename` varchar(100) NOT NULL,
2638   -`filename` varchar(100) NOT NULL,
2639   -`userid` int(11) NOT NULL,
2640   -`uploaddate` timestamp NOT NULL,
2641   -`action` char(1) NOT NULL COMMENT 'A = Add, C = Checkin',
2642   -`document_id` int(11) default NULL
2643   -) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2644   -
2645   -CREATE TABLE `download_files` (
2646   -`document_id` int(10) unsigned NOT NULL,
2647   -`session` varchar(100) NOT NULL,
2648   -`download_date` timestamp NULL default CURRENT_TIMESTAMP,
2649   -`downloaded` int(10) unsigned NOT NULL default '0',
2650   -`filesize` int(10) unsigned NOT NULL,
2651   -`content_version` int(10) unsigned NOT NULL,
2652   -`hash` varchar(100) NOT NULL,
2653   -PRIMARY KEY (`document_id`,`session`)
2654   -) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2655   -
2656   -CREATE TABLE `index_files` (
2657   -`document_id` int(10) unsigned NOT NULL,
2658   -`user_id` int(10) unsigned NOT NULL,
2659   -`indexdate` timestamp NOT NULL,
2660   -PRIMARY KEY (`document_id`)
2661   -) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  2297 +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  2298 +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  2299 +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  2300 +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  2301 +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  2302 +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  2303 +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
2662 2304  
2663   -SET FOREIGN_KEY_CHECKS=1;
  2305 +-- Dump completed on 2007-09-25 21:55:41
... ...