place tblWorkflowLog after tblWorkflowDocumentContent

This commit is contained in:
Uwe Steinmann 2018-11-16 15:41:26 +01:00
parent 4e0a34966c
commit 39a7c26977
3 changed files with 54 additions and 53 deletions

View File

@ -805,6 +805,30 @@ CREATE TABLE `tblWorkflowTransitionGroups` (
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowDocumentContent`
--
CREATE TABLE `tblWorkflowDocumentContent` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent` int(11) DEFAULT NULL,
`workflow` int(11) DEFAULT NULL,
`document` int(11) DEFAULT NULL,
`version` smallint(5) DEFAULT NULL,
`state` int(11) DEFAULT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `tblWorkflowDocument_document` (`document`),
KEY `tblWorkflowDocument_workflow` (`workflow`),
KEY `tblWorkflowDocument_state` (`state`),
CONSTRAINT `tblWorkflowDocument_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblWorkflowDocument_state` FOREIGN KEY (`state`) REFERENCES `tblWorkflowStates` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblWorkflowDocumentContent_parent` FOREIGN KEY (`parent`) REFERENCES `tblWorkflowDocumentContent` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblWorkflowDocument_workflow` FOREIGN KEY (`workflow`) REFERENCES `tblWorkflows` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowLog`
--
@ -827,29 +851,6 @@ CREATE TABLE `tblWorkflowLog` (
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowDocumentContent`
--
CREATE TABLE `tblWorkflowDocumentContent` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent` int(11) DEFAULT NULL,
`workflow` int(11) DEFAULT NULL,
`document` int(11) DEFAULT NULL,
`version` smallint(5) DEFAULT NULL,
`state` int(11) DEFAULT NULL,
`date` datetime NOT NULL,
KEY `tblWorkflowDocument_document` (`document`),
KEY `tblWorkflowDocument_workflow` (`workflow`),
KEY `tblWorkflowDocument_state` (`state`),
CONSTRAINT `tblWorkflowDocument_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblWorkflowDocument_state` FOREIGN KEY (`state`) REFERENCES `tblWorkflowStates` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblWorkflowDocumentContent_parent` FOREIGN KEY (`parent`) REFERENCES `tblWorkflowDocumentContent` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblWorkflowDocument_workflow` FOREIGN KEY (`workflow`) REFERENCES `tblWorkflows` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowMandatoryWorkflow`
--

View File

@ -663,21 +663,6 @@ CREATE TABLE "tblWorkflowTransitionGroups" (
-- --------------------------------------------------------
--
-- Table structure for workflow log
--
CREATE TABLE "tblWorkflowLog" (
"id" SERIAL UNIQUE,
"workflowdocumentcontent" INTEGER DEFAULT NULL REFERENCES "tblWorkflowDocumentContent" ("id") ON DELETE CASCADE,
"userid" INTEGER default NULL REFERENCES "tblUsers" ("id") ON DELETE CASCADE,
"transition" INTEGER default NULL REFERENCES "tblWorkflowTransitions" ("id") ON DELETE CASCADE,
"date" TIMESTAMP default NULL,
"comment" text
) ;
-- --------------------------------------------------------
--
-- Table structure for workflow document relation
--
@ -694,6 +679,21 @@ CREATE TABLE "tblWorkflowDocumentContent" (
-- --------------------------------------------------------
--
-- Table structure for workflow log
--
CREATE TABLE "tblWorkflowLog" (
"id" SERIAL UNIQUE,
"workflowdocumentcontent" INTEGER DEFAULT NULL REFERENCES "tblWorkflowDocumentContent" ("id") ON DELETE CASCADE,
"userid" INTEGER default NULL REFERENCES "tblUsers" ("id") ON DELETE CASCADE,
"transition" INTEGER default NULL REFERENCES "tblWorkflowTransitions" ("id") ON DELETE CASCADE,
"date" TIMESTAMP default NULL,
"comment" text
) ;
-- --------------------------------------------------------
--
-- Table structure for mandatory workflows
--

View File

@ -672,21 +672,6 @@ CREATE TABLE `tblWorkflowTransitionGroups` (
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowLog`
--
CREATE TABLE `tblWorkflowLog` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`workflowdocumentcontent` INTEGER DEFAULT NULL REFERENCES `tblWorkflowDocumentContent` (`id`) ON DELETE CASCADE,
`userid` INTEGER default NULL REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`transition` INTEGER default NULL REFERENCES `tblWorkflowTransitions` (`id`) ON DELETE CASCADE,
`date` datetime NOT NULL,
`comment` text
) ;
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowDocumentContent`
--
@ -704,6 +689,21 @@ CREATE TABLE `tblWorkflowDocumentContent` (
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowLog`
--
CREATE TABLE `tblWorkflowLog` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`workflowdocumentcontent` INTEGER DEFAULT NULL REFERENCES `tblWorkflowDocumentContent` (`id`) ON DELETE CASCADE,
`userid` INTEGER default NULL REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`transition` INTEGER default NULL REFERENCES `tblWorkflowTransitions` (`id`) ON DELETE CASCADE,
`date` datetime NOT NULL,
`comment` text
) ;
-- --------------------------------------------------------
--
-- Table structure for table `tblWorkflowMandatoryWorkflow`
--