\r\nX-Mailer: Group-Office\r\nMIME-Version: 1.0\r\nContent-Type: multipart/alternative;\r\n boundary="b1=_zZVA8SUigYNXRT2XRZGMGuQxM7Xvg03uTZMbTAAfs"\r\nContent-Transfer-Encoding: 8bit\r\n\r\n--b1=_zZVA8SUigYNXRT2XRZGMGuQxM7Xvg03uTZMbTAAfs\r\nContent-Type: text/plain; charset=us-ascii\r\n\r\nHi {contact:firstName},\r\n\r\n{body}\r\n\r\nBest regards\r\n\r\n\r\n{user:displayName}\r\n\r\n--b1=_zZVA8SUigYNXRT2XRZGMGuQxM7Xvg03uTZMbTAAfs\r\nContent-Type: text/html; charset=us-ascii\r\n\r\nHi {contact:firstName},
\r\n
\r\n{body}
\r\n
\r\nBest regards
\r\n
\r\n
\r\n{user:displayName}
\r\n\r\n\r\n--b1=_zZVA8SUigYNXRT2XRZGMGuQxM7Xvg03uTZMbTAAfs--\r\n', NULL, '', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `go_template_group`
--
CREATE TABLE `go_template_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `go_working_weeks`
--
CREATE TABLE `go_working_weeks` (
`user_id` int(11) NOT NULL DEFAULT '0',
`mo_work_hours` double NOT NULL DEFAULT '8',
`tu_work_hours` double NOT NULL DEFAULT '8',
`we_work_hours` double NOT NULL DEFAULT '8',
`th_work_hours` double NOT NULL DEFAULT '8',
`fr_work_hours` double NOT NULL DEFAULT '8',
`sa_work_hours` double NOT NULL DEFAULT '0',
`su_work_hours` double NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `history_log_entry`
--
CREATE TABLE `history_log_entry` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`action` int(11) DEFAULT NULL,
`description` varchar(384) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`changes` text COLLATE utf8mb4_unicode_ci,
`createdAt` datetime DEFAULT NULL,
`createdBy` int(11) DEFAULT NULL,
`aclId` int(11) DEFAULT NULL,
`removeAcl` tinyint(1) NOT NULL DEFAULT '0',
`entityTypeId` int(11) NOT NULL,
`entityId` varchar(100) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
`remoteIp` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`requestId` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_log_entry_core_user_idx` (`createdBy`),
KEY `fk_log_entry_core_acl1_idx` (`aclId`),
KEY `fk_log_entry_core_entity1_idx` (`entityTypeId`),
KEY `entityId` (`entityId`),
KEY `history_log_entry_createdAt_index` (`createdAt`),
KEY `history_log_entry_removeAcl_action_index` (`removeAcl`,`action`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `notes_note`
--
CREATE TABLE `notes_note` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`noteBookId` int(11) NOT NULL,
`createdBy` int(11) DEFAULT NULL,
`modifiedBy` int(11) DEFAULT NULL,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` mediumtext COLLATE utf8mb4_unicode_ci,
`filesFolderId` int(11) DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '',
`createdAt` datetime DEFAULT NULL,
`modifiedAt` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`createdBy`),
KEY `category_id` (`noteBookId`),
KEY `modifiedBy` (`modifiedBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=173 ;
-- --------------------------------------------------------
--
-- Table structure for table `notes_note_book`
--
CREATE TABLE `notes_note_book` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`deletedAt` datetime DEFAULT NULL,
`createdBy` int(11) DEFAULT NULL,
`aclId` int(11) NOT NULL,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`filesFolderId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `aclId` (`aclId`),
KEY `createdBy` (`createdBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=66 ;
--
-- Dumping data for table `notes_note_book`
--
INSERT INTO `notes_note_book` VALUES
(65, NULL, 1, 13, 'Shared', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `notes_note_custom_fields`
--
CREATE TABLE `notes_note_custom_fields` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `notes_note_image`
--
CREATE TABLE `notes_note_image` (
`noteId` int(11) NOT NULL,
`blobId` binary(40) NOT NULL,
PRIMARY KEY (`noteId`,`blobId`),
KEY `blobId` (`blobId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `notes_user_settings`
--
CREATE TABLE `notes_user_settings` (
`userId` int(11) NOT NULL,
`defaultNoteBookId` int(11) DEFAULT NULL,
`rememberLastItems` tinyint(1) DEFAULT '0',
`lastNoteBookIds` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '',
PRIMARY KEY (`userId`),
KEY `defaultNoteBookId` (`defaultNoteBookId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `otp_secret`
--
CREATE TABLE `otp_secret` (
`userId` int(11) NOT NULL,
`secret` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
`createdAt` datetime NOT NULL,
`verified` tinyint(1) NOT NULL DEFAULT '0',
`expiresAt` datetime DEFAULT NULL,
PRIMARY KEY (`userId`),
KEY `user` (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `su_announcements`
--
CREATE TABLE `su_announcements` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`acl_id` int(11) NOT NULL,
`due_time` int(11) NOT NULL DEFAULT '0',
`ctime` int(11) NOT NULL DEFAULT '0',
`mtime` int(11) NOT NULL DEFAULT '0',
`title` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`content` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `due_time` (`due_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=2 ;
--
-- Dumping data for table `su_announcements`
--
INSERT INTO `su_announcements` VALUES
(1, 1, 22, 0, [[timestamp]], [[timestamp]], 'Welcome to Group-Office!', 'Thank you for installing Group-Office!
\nHere''s a link to help you get started: https://groupoffice.readthedocs.io/en/latest/getting-started.html
\nWe hope you''ll enjoy Group-Office!
');
-- --------------------------------------------------------
--
-- Table structure for table `su_latest_read_announcement_records`
--
CREATE TABLE `su_latest_read_announcement_records` (
`user_id` int(11) NOT NULL,
`announcement_id` int(11) DEFAULT NULL,
`announcement_ctime` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`),
KEY `su_latest_read_announcement_records_su_announcements_id_fk` (`announcement_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `su_notes`
--
CREATE TABLE `su_notes` (
`user_id` int(11) NOT NULL,
`text` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `su_rss_feeds`
--
CREATE TABLE `su_rss_feeds` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`url` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`summary` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `su_rss_feeds_core_user_id_fk` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `su_visible_calendars`
--
CREATE TABLE `su_visible_calendars` (
`user_id` int(11) NOT NULL,
`calendar_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`calendar_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `su_visible_lists`
--
CREATE TABLE `su_visible_lists` (
`user_id` int(11) NOT NULL,
`tasklist_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`tasklist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `sync_addressbook_user`
--
CREATE TABLE `sync_addressbook_user` (
`addressBookId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`isDefault` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`addressBookId`,`userId`),
KEY `userId` (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `sync_calendar_user`
--
CREATE TABLE `sync_calendar_user` (
`calendar_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`default_calendar` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`calendar_id`,`user_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `sync_devices`
--
CREATE TABLE `sync_devices` (
`id` int(11) NOT NULL DEFAULT '0',
`manufacturer` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`model` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`software_version` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user_id` int(11) NOT NULL DEFAULT '0',
`uri` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`UTC` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL,
`vcalendar_version` varchar(4) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `sync_note_categories_user`
--
CREATE TABLE `sync_note_categories_user` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0',
`default_category` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`category_id`,`user_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `sync_settings`
--
CREATE TABLE `sync_settings` (
`user_id` int(11) NOT NULL DEFAULT '0',
`addressbook_id` int(11) NOT NULL DEFAULT '0',
`calendar_id` int(11) NOT NULL DEFAULT '0',
`tasklist_id` int(11) NOT NULL DEFAULT '0',
`note_category_id` int(11) NOT NULL DEFAULT '0',
`account_id` int(11) NOT NULL DEFAULT '0',
`server_is_master` tinyint(1) NOT NULL DEFAULT '1',
`max_days_old` tinyint(4) NOT NULL DEFAULT '0',
`delete_old_events` tinyint(1) NOT NULL DEFAULT '1',
`allowDeletes` tinyint(1) DEFAULT '0',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `sync_tasklist_user`
--
CREATE TABLE `sync_tasklist_user` (
`tasklistId` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL DEFAULT '0',
`isDefault` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`tasklistId`,`userId`),
KEY `userId` (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `sync_user_note_book`
--
CREATE TABLE `sync_user_note_book` (
`noteBookId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`isDefault` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`noteBookId`,`userId`),
KEY `user` (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_alert`
--
CREATE TABLE `tasks_alert` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`when` datetime NOT NULL,
`acknowledged` datetime DEFAULT NULL,
`relatedTo` text COLLATE utf8mb4_unicode_ci,
`action` smallint(2) NOT NULL DEFAULT '1',
`offset` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`relativeTo` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT 'start',
`taskId` int(11) unsigned NOT NULL,
`userId` int(11) NOT NULL,
PRIMARY KEY (`id`,`taskId`,`userId`),
KEY `fk_tasks_alert_tasks_task_user1_idx` (`taskId`,`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_category`
--
CREATE TABLE `tasks_category` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`ownerId` int(11) DEFAULT NULL,
`tasklistId` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`ownerId`),
KEY `tasks_category_tasklist_ibfk_9` (`tasklistId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_default_alert`
--
CREATE TABLE `tasks_default_alert` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`when` datetime NOT NULL,
`relatedTo` text COLLATE utf8mb4_unicode_ci,
`action` smallint(2) NOT NULL DEFAULT '1',
`offset` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`relativeTo` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT 'start',
`withTime` tinyint(1) NOT NULL DEFAULT '1',
`tasklistId` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`,`tasklistId`),
KEY `fk_tasks_default_alert_tasks_tasklist1_idx` (`tasklistId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_portlet_tasklist`
--
CREATE TABLE `tasks_portlet_tasklist` (
`userId` int(11) NOT NULL,
`tasklistId` int(11) unsigned NOT NULL,
PRIMARY KEY (`userId`,`tasklistId`),
KEY `tasklistId` (`tasklistId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_task`
--
CREATE TABLE `tasks_task` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`uid` varchar(190) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT '',
`tasklistId` int(11) unsigned NOT NULL,
`groupId` int(10) unsigned DEFAULT NULL,
`responsibleUserId` int(11) DEFAULT NULL,
`createdBy` int(11) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`modifiedAt` datetime NOT NULL,
`modifiedBy` int(11) DEFAULT NULL,
`filesFolderId` int(11) DEFAULT NULL,
`due` date DEFAULT NULL,
`start` date DEFAULT NULL,
`estimatedDuration` int(11) DEFAULT NULL COMMENT 'Duration in seconds',
`progress` tinyint(2) NOT NULL DEFAULT '1',
`progressUpdated` datetime DEFAULT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`color` char(6) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`recurrenceRule` varchar(400) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`priority` int(11) NOT NULL DEFAULT '1',
`freeBusyStatus` char(4) COLLATE utf8mb4_unicode_ci DEFAULT 'busy',
`privacy` varchar(7) COLLATE utf8mb4_unicode_ci DEFAULT 'public',
`percentComplete` tinyint(4) NOT NULL DEFAULT '0',
`uri` varchar(190) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL,
`vcalendarBlobId` binary(40) DEFAULT NULL,
`latitude` decimal(10,8) DEFAULT NULL,
`longitude` decimal(11,8) DEFAULT NULL,
`location` text COLLATE utf8mb4_unicode_ci,
`projectId` int(10) unsigned DEFAULT NULL,
`mileStoneId` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `list_id` (`tasklistId`),
KEY `groupId` (`groupId`),
KEY `rrule` (`recurrenceRule`(191)),
KEY `uuid` (`uid`),
KEY `fkModifiedBy` (`modifiedBy`),
KEY `createdBy` (`createdBy`),
KEY `filesFolderId` (`filesFolderId`),
KEY `tasks_task_groupId_idx` (`groupId`),
KEY `tasks_vcalendar_blob_idx` (`vcalendarBlobId`),
KEY `tasks_task_core_user_id_fk` (`responsibleUserId`),
KEY `tasks_task_progress_index` (`progress`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_tasklist`
--
CREATE TABLE `tasks_tasklist` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`role` tinyint(2) unsigned DEFAULT NULL,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`createdBy` int(11) DEFAULT NULL,
`defaultColor` varchar(21) COLLATE utf8mb4_unicode_ci NOT NULL,
`highestItemModSeq` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT '0',
`aclId` int(11) NOT NULL,
`ownerId` int(11) NOT NULL DEFAULT '1',
`filesFolderId` int(11) DEFAULT NULL,
`projectId` int(11) DEFAULT NULL,
`groupingId` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fkCreatedBy` (`createdBy`),
KEY `fkAcl` (`aclId`),
KEY `tasks_tasklist_tasks_tasklist_grouping_null_fk` (`groupingId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_tasklist_group`
--
CREATE TABLE `tasks_tasklist_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`color` char(6) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sortOrder` smallint(2) unsigned NOT NULL DEFAULT '0',
`tasklistId` int(11) unsigned NOT NULL,
`progressChange` tinyint(2) DEFAULT NULL,
PRIMARY KEY (`id`,`tasklistId`),
UNIQUE KEY `fk_tasks_column_tasks_id_idx` (`id`),
UNIQUE KEY `tasks_tasklist_group_pk` (`id`),
KEY `fk_tasks_column_tasks_tasklist1_idx` (`tasklistId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_tasklist_grouping`
--
CREATE TABLE `tasks_tasklist_grouping` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL,
`order` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tasks_tasklist_grouping_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_tasklist_user`
--
CREATE TABLE `tasks_tasklist_user` (
`tasklistId` int(11) unsigned NOT NULL,
`userId` int(11) NOT NULL,
`modSeq` int(11) NOT NULL DEFAULT '0',
`color` varchar(21) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sortOrder` int(11) DEFAULT NULL,
`isVisible` tinyint(1) NOT NULL DEFAULT '0',
`isSubscribed` tinyint(1) NOT NULL DEFAULT '0',
`syncToDevice` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`tasklistId`,`userId`),
KEY `fk_tasks_tasklist_user_tasks_tasklist1_idx` (`tasklistId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_task_category`
--
CREATE TABLE `tasks_task_category` (
`taskId` int(11) unsigned NOT NULL,
`categoryId` int(11) unsigned NOT NULL,
PRIMARY KEY (`taskId`,`categoryId`),
KEY `tasks_task_category_ibfk_2` (`categoryId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_task_custom_fields`
--
CREATE TABLE `tasks_task_custom_fields` (
`id` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_task_user`
--
CREATE TABLE `tasks_task_user` (
`taskId` int(11) unsigned NOT NULL,
`userId` int(11) NOT NULL,
`modSeq` int(11) NOT NULL DEFAULT '0',
`freeBusyStatus` char(4) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'busy',
PRIMARY KEY (`taskId`,`userId`),
KEY `fk_tasks_task_user_tasks_task1_idx` (`taskId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tasks_user_settings`
--
CREATE TABLE `tasks_user_settings` (
`userId` int(11) NOT NULL,
`defaultTasklistId` int(11) unsigned DEFAULT NULL,
`rememberLastItems` tinyint(1) NOT NULL DEFAULT '0',
`lastTasklistIds` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`defaultDate` tinyint(1) DEFAULT '0',
PRIMARY KEY (`userId`),
KEY `tasks_user_settings_tasks_tasklist_id_fk` (`defaultTasklistId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `zpa_devices`
--
CREATE TABLE `zpa_devices` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`device_id` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`device_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`remote_addr` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`can_connect` tinyint(1) NOT NULL DEFAULT '0',
`ctime` int(11) NOT NULL,
`mtime` int(11) NOT NULL,
`new` tinyint(1) NOT NULL DEFAULT '1',
`username` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`comment` text COLLATE utf8mb4_unicode_ci,
`as_version` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `device_id` (`device_id`,`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `addressbook_address`
--
ALTER TABLE `addressbook_address`
ADD CONSTRAINT `addressbook_address_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_addressbook`
--
ALTER TABLE `addressbook_addressbook`
ADD CONSTRAINT `addressbook_addressbook_ibfk_1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `addressbook_addressbook_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
--
-- Constraints for table `addressbook_contact`
--
ALTER TABLE `addressbook_contact`
ADD CONSTRAINT `addressbook_contact_ibfk_1` FOREIGN KEY (`addressBookId`) REFERENCES `addressbook_addressbook` (`id`),
ADD CONSTRAINT `addressbook_contact_ibfk_2` FOREIGN KEY (`photoBlobId`) REFERENCES `core_blob` (`id`),
ADD CONSTRAINT `addressbook_contact_ibfk_3` FOREIGN KEY (`modifiedBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `addressbook_contact_ibfk_4` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `addressbook_contact_ibfk_5` FOREIGN KEY (`goUserId`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `addressbook_contact_ibfk_6` FOREIGN KEY (`vcardBlobId`) REFERENCES `core_blob` (`id`);
--
-- Constraints for table `addressbook_contact_custom_fields`
--
ALTER TABLE `addressbook_contact_custom_fields`
ADD CONSTRAINT `addressbook_contact_custom_fields_ibfk_1` FOREIGN KEY (`id`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_contact_group`
--
ALTER TABLE `addressbook_contact_group`
ADD CONSTRAINT `addressbook_contact_group_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `addressbook_contact_group_ibfk_2` FOREIGN KEY (`groupId`) REFERENCES `addressbook_group` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_contact_star`
--
ALTER TABLE `addressbook_contact_star`
ADD CONSTRAINT `addressbook_contact_star_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `addressbook_contact_star_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_date`
--
ALTER TABLE `addressbook_date`
ADD CONSTRAINT `addressbook_date_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_email_address`
--
ALTER TABLE `addressbook_email_address`
ADD CONSTRAINT `addressbook_email_address_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_group`
--
ALTER TABLE `addressbook_group`
ADD CONSTRAINT `addressbook_group_ibfk_1` FOREIGN KEY (`addressBookId`) REFERENCES `addressbook_addressbook` (`id`);
--
-- Constraints for table `addressbook_phone_number`
--
ALTER TABLE `addressbook_phone_number`
ADD CONSTRAINT `addressbook_phone_number_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_portlet_birthday`
--
ALTER TABLE `addressbook_portlet_birthday`
ADD CONSTRAINT `addressbook_portlet_birthday_fk1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `addressbook_portlet_birthday_fk2` FOREIGN KEY (`addressBookId`) REFERENCES `addressbook_addressbook` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_url`
--
ALTER TABLE `addressbook_url`
ADD CONSTRAINT `addressbook_url_ibfk_1` FOREIGN KEY (`contactId`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `addressbook_user_settings`
--
ALTER TABLE `addressbook_user_settings`
ADD CONSTRAINT `addressbook_user_settings_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `addressbook_user_settings_ibfk_2` FOREIGN KEY (`defaultAddressBookId`) REFERENCES `addressbook_addressbook` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `bookmarks_bookmark`
--
ALTER TABLE `bookmarks_bookmark`
ADD CONSTRAINT `bookmarks_bookmark_ibfk_1` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `bookmarks_bookmark_ibfk_2` FOREIGN KEY (`categoryId`) REFERENCES `bookmarks_category` (`id`),
ADD CONSTRAINT `core_blob_bookmark_logo` FOREIGN KEY (`logo`) REFERENCES `core_blob` (`id`);
--
-- Constraints for table `bookmarks_category`
--
ALTER TABLE `bookmarks_category`
ADD CONSTRAINT `bookmarks_category_acl_ibfk_1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `bookmarks_category_ibfk_1` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `calendar_calendar`
--
ALTER TABLE `calendar_calendar`
ADD CONSTRAINT `fk_calendar_calendar_calendar_resource_group` FOREIGN KEY (`groupId`) REFERENCES `calendar_resource_group` (`id`),
ADD CONSTRAINT `fk_calendar_calendar_core_acl1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `fk_calendar_calendar_core_user_creator` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `fk_calendar_calendar_core_user_owner` FOREIGN KEY (`ownerId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `calendar_calendar_custom_fields`
--
ALTER TABLE `calendar_calendar_custom_fields`
ADD CONSTRAINT `fk_calendar_cf1` FOREIGN KEY (`id`) REFERENCES `calendar_calendar` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `calendar_calendar_event`
--
ALTER TABLE `calendar_calendar_event`
ADD CONSTRAINT `fk_calendar_calendar_event_calendar_calendar1` FOREIGN KEY (`calendarId`) REFERENCES `calendar_calendar` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_calendar_calendar_event_calendar_event1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_calendar_user`
--
ALTER TABLE `calendar_calendar_user`
ADD CONSTRAINT `fk_calendar_calendar_user_calendar_calendar1` FOREIGN KEY (`id`) REFERENCES `calendar_calendar` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_calendar_calendar_user_core_user1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_category`
--
ALTER TABLE `calendar_category`
ADD CONSTRAINT `calendar_category_calendar_ibfk_9` FOREIGN KEY (`calendarId`) REFERENCES `calendar_calendar` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `calendar_category_ibfk_1` FOREIGN KEY (`ownerId`) REFERENCES `core_user` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `calendar_default_alert`
--
ALTER TABLE `calendar_default_alert`
ADD CONSTRAINT `fk_calendar_default_alert_calendar_calendar1` FOREIGN KEY (`fk`, `userId`) REFERENCES `calendar_calendar_user` (`id`, `userId`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `calendar_default_alert_with_time`
--
ALTER TABLE `calendar_default_alert_with_time`
ADD CONSTRAINT `fk_calendar_default_alert_with_time_calendar_calendar1` FOREIGN KEY (`fk`, `userId`) REFERENCES `calendar_calendar_user` (`id`, `userId`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `calendar_event`
--
ALTER TABLE `calendar_event`
ADD CONSTRAINT `fk_calendar_event_core_user1` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `fk_calendar_event_core_user2` FOREIGN KEY (`modifiedBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `calendar_event_alert`
--
ALTER TABLE `calendar_event_alert`
ADD CONSTRAINT `fk_calendar_event_alert_calendar_event_user1` FOREIGN KEY (`fk`, `userId`) REFERENCES `calendar_event_user` (`eventId`, `userId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_event_category`
--
ALTER TABLE `calendar_event_category`
ADD CONSTRAINT `calendar_event_category_ibfk_2` FOREIGN KEY (`categoryId`) REFERENCES `calendar_category` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `calendar_task_category_ibfk_1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE;
--
-- Constraints for table `calendar_event_custom_fields`
--
ALTER TABLE `calendar_event_custom_fields`
ADD CONSTRAINT `fk_calendar_event_cf1` FOREIGN KEY (`id`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE;
--
-- Constraints for table `calendar_event_link`
--
ALTER TABLE `calendar_event_link`
ADD CONSTRAINT `fk_calendar_event_link_core_blob1` FOREIGN KEY (`blobId`) REFERENCES `core_blob` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_event_attachment_calendar_event1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_event_location`
--
ALTER TABLE `calendar_event_location`
ADD CONSTRAINT `fk_event_location_calendar_event1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_event_related`
--
ALTER TABLE `calendar_event_related`
ADD CONSTRAINT `fk_calendar_event_related_calendar_event1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_event_user`
--
ALTER TABLE `calendar_event_user`
ADD CONSTRAINT `fk_calendar_event_user_calendar_event1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_calendar_event_user_core_blob1` FOREIGN KEY (`veventBlobId`) REFERENCES `core_blob` (`id`) ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_calendar_event_user_core_user1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `calendar_participant`
--
ALTER TABLE `calendar_participant`
ADD CONSTRAINT `fk_participant_calendar_event1` FOREIGN KEY (`eventId`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_preferences`
--
ALTER TABLE `calendar_preferences`
ADD CONSTRAINT `calendar_preferences_calendar_calendar_id_fk` FOREIGN KEY (`defaultCalendarId`) REFERENCES `calendar_calendar` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `calendar_preferences_core_user_id_fk` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `calendar_recurrence_override`
--
ALTER TABLE `calendar_recurrence_override`
ADD CONSTRAINT `fk_recurrence_override_calendar_event1` FOREIGN KEY (`fk`) REFERENCES `calendar_event` (`eventId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `calendar_resource_group`
--
ALTER TABLE `calendar_resource_group`
ADD CONSTRAINT `calendar_resource_group_core_user_id_fk` FOREIGN KEY (`defaultOwnerId`) REFERENCES `core_user` (`id`),
ADD CONSTRAINT `fk_calendar_resource_group_core_user_creator` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `calendar_view`
--
ALTER TABLE `calendar_view`
ADD CONSTRAINT `calendar_View_ownerId` FOREIGN KEY (`ownerId`) REFERENCES `core_user` (`id`),
ADD CONSTRAINT `calendar_view_aclId` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`);
--
-- Constraints for table `comments_comment`
--
ALTER TABLE `comments_comment`
ADD CONSTRAINT `comments_comment_core_entity_id_fk` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_comments_comment_core_user1` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `fk_comments_comment_core_user2` FOREIGN KEY (`modifiedBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `comments_comment_attachment`
--
ALTER TABLE `comments_comment_attachment`
ADD CONSTRAINT `comments_comment_attachment_comments_comment_id_fk` FOREIGN KEY (`commentId`) REFERENCES `comments_comment` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `comments_comment_attachment_core_blob_id_fk` FOREIGN KEY (`blobId`) REFERENCES `core_blob` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `comments_comment_image`
--
ALTER TABLE `comments_comment_image`
ADD CONSTRAINT `comments_comment_image_ibfk_1` FOREIGN KEY (`blobId`) REFERENCES `core_blob` (`id`),
ADD CONSTRAINT `comments_comment_image_ibfk_2` FOREIGN KEY (`commentId`) REFERENCES `comments_comment` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `comments_comment_label`
--
ALTER TABLE `comments_comment_label`
ADD CONSTRAINT `fk_comments_label_has_comments_comment_comments_comment1` FOREIGN KEY (`commentId`) REFERENCES `comments_comment` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_comments_label_has_comments_comment_comments_label1` FOREIGN KEY (`labelId`) REFERENCES `comments_label` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_acl`
--
ALTER TABLE `core_acl`
ADD CONSTRAINT `core_acl_ibfk_1` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `core_acl_ibfk_2` FOREIGN KEY (`ownedBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `core_acl_group`
--
ALTER TABLE `core_acl_group`
ADD CONSTRAINT `core_acl_group_ibfk_1` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_acl_group_ibfk_2` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `core_acl_group_changes`
--
ALTER TABLE `core_acl_group_changes`
ADD CONSTRAINT `all` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `group` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `core_alert`
--
ALTER TABLE `core_alert`
ADD CONSTRAINT `fk_alert_entityType` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_alert_user` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `core_auth_allow_group`
--
ALTER TABLE `core_auth_allow_group`
ADD CONSTRAINT `core_auth_allow_group_ibfk_1` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_auth_method`
--
ALTER TABLE `core_auth_method`
ADD CONSTRAINT `core_auth_method_ibfk_1` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_auth_password`
--
ALTER TABLE `core_auth_password`
ADD CONSTRAINT `core_auth_password_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_auth_remember_me`
--
ALTER TABLE `core_auth_remember_me`
ADD CONSTRAINT `core_auth_remember_me_core_user_id_fk` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_core_auth_remember_me_core_client1` FOREIGN KEY (`clientId`) REFERENCES `core_client` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_auth_token`
--
ALTER TABLE `core_auth_token`
ADD CONSTRAINT `fk_core_auth_token_core_client1` FOREIGN KEY (`clientId`) REFERENCES `core_client` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_core_auth_token_core_user1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_change`
--
ALTER TABLE `core_change`
ADD CONSTRAINT `core_change_ibfk_1` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_change_ibfk_2` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `core_change_user`
--
ALTER TABLE `core_change_user`
ADD CONSTRAINT `core_change_user_ibfk_1` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_change_user_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_change_user_modseq`
--
ALTER TABLE `core_change_user_modseq`
ADD CONSTRAINT `core_change_user_modseq_ibfk_1` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_change_user_modseq_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_client`
--
ALTER TABLE `core_client`
ADD CONSTRAINT `core_client_core_user_id_fk` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_cron_job`
--
ALTER TABLE `core_cron_job`
ADD CONSTRAINT `core_cron_job_ibfk_1` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_customfields_field`
--
ALTER TABLE `core_customfields_field`
ADD CONSTRAINT `core_customfields_field_ibfk_1` FOREIGN KEY (`fieldSetId`) REFERENCES `core_customfields_field_set` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_customfields_field_set`
--
ALTER TABLE `core_customfields_field_set`
ADD CONSTRAINT `core_customfields_field_set_core_customfields_field_set_id_fk` FOREIGN KEY (`parentFieldSetId`) REFERENCES `core_customfields_field_set` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `core_customfields_field_set_ibfk_1` FOREIGN KEY (`entityId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_customfields_field_set_ibfk_2` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`);
--
-- Constraints for table `core_customfields_select_option`
--
ALTER TABLE `core_customfields_select_option`
ADD CONSTRAINT `core_customfields_select_option_ibfk_1` FOREIGN KEY (`fieldId`) REFERENCES `core_customfields_field` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_customfields_select_option_ibfk_2` FOREIGN KEY (`fieldId`) REFERENCES `core_customfields_field` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_customfields_select_option_ibfk_3` FOREIGN KEY (`parentId`) REFERENCES `core_customfields_select_option` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_email_template`
--
ALTER TABLE `core_email_template`
ADD CONSTRAINT `core_email_template_ibfk_2` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_email_template_attachment`
--
ALTER TABLE `core_email_template_attachment`
ADD CONSTRAINT `core_email_template_attachment_ibfk_1` FOREIGN KEY (`blobId`) REFERENCES `core_blob` (`id`),
ADD CONSTRAINT `core_email_template_attachment_ibfk_2` FOREIGN KEY (`emailTemplateId`) REFERENCES `core_email_template` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_entity`
--
ALTER TABLE `core_entity`
ADD CONSTRAINT `core_entity_ibfk_1` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_entity_ibfk_2` FOREIGN KEY (`defaultAclId`) REFERENCES `core_acl` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_entity_filter`
--
ALTER TABLE `core_entity_filter`
ADD CONSTRAINT `core_entity_filter_ibfk_1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `core_entity_filter_ibfk_2` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_group`
--
ALTER TABLE `core_group`
ADD CONSTRAINT `core_group_ibfk_1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `core_group_ibfk_2` FOREIGN KEY (`isUserGroupFor`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_group_default_group`
--
ALTER TABLE `core_group_default_group`
ADD CONSTRAINT `core_group_default_group_ibfk_1` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_import_mapping`
--
ALTER TABLE `core_import_mapping`
ADD CONSTRAINT `core_import_mapping_core_entity_null_fk` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_link`
--
ALTER TABLE `core_link`
ADD CONSTRAINT `fromEntity` FOREIGN KEY (`fromEntityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `toEntity` FOREIGN KEY (`toEntityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_module`
--
ALTER TABLE `core_module`
ADD CONSTRAINT `core_module_core_acl_id_fk` FOREIGN KEY (`shadowAclId`) REFERENCES `core_acl` (`id`);
--
-- Constraints for table `core_oauth_access_token`
--
ALTER TABLE `core_oauth_access_token`
ADD CONSTRAINT `core_oauth_access_token_ibfk_2` FOREIGN KEY (`userIdentifier`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_oauth_access_token_ibfk_3` FOREIGN KEY (`clientId`) REFERENCES `core_oauth_client` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_pdf_block`
--
ALTER TABLE `core_pdf_block`
ADD CONSTRAINT `core_pdf_block_ibfk_1` FOREIGN KEY (`pdfTemplateId`) REFERENCES `core_pdf_template` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_pdf_template`
--
ALTER TABLE `core_pdf_template`
ADD CONSTRAINT `core_pdf_template_core_blob_id_fk` FOREIGN KEY (`logoBlobId`) REFERENCES `core_blob` (`id`),
ADD CONSTRAINT `core_pdf_template_ibfk_1` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_pdf_template_ibfk_2` FOREIGN KEY (`stationaryBlobId`) REFERENCES `core_blob` (`id`);
--
-- Constraints for table `core_permission`
--
ALTER TABLE `core_permission`
ADD CONSTRAINT `fk_permission_group` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_permission_module` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `core_principal`
--
ALTER TABLE `core_principal`
ADD CONSTRAINT `fk_core_principal_core_acl1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `lnk_core_blob_core_principal` FOREIGN KEY (`avatarId`) REFERENCES `core_blob` (`id`) ON UPDATE NO ACTION,
ADD CONSTRAINT `lnk_core_entity_core_principal` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `core_search`
--
ALTER TABLE `core_search`
ADD CONSTRAINT `core_search_ibfk_1` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `core_search_ibfk_2` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_search_word`
--
ALTER TABLE `core_search_word`
ADD CONSTRAINT `core_search_word_ibfk_1` FOREIGN KEY (`searchId`) REFERENCES `core_search` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_setting`
--
ALTER TABLE `core_setting`
ADD CONSTRAINT `module` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_smtp_account`
--
ALTER TABLE `core_smtp_account`
ADD CONSTRAINT `core_smtp_account_ibfk_1` FOREIGN KEY (`moduleId`) REFERENCES `core_module` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_smtp_account_ibfk_2` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`);
--
-- Constraints for table `core_spreadsheet_export`
--
ALTER TABLE `core_spreadsheet_export`
ADD CONSTRAINT `core_spreadsheet_export_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_spreadsheet_export_ibfk_2` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_user`
--
ALTER TABLE `core_user`
ADD CONSTRAINT `fk_user_avatar_id` FOREIGN KEY (`avatarId`) REFERENCES `core_blob` (`id`) ON UPDATE NO ACTION;
--
-- Constraints for table `core_user_custom_fields`
--
ALTER TABLE `core_user_custom_fields`
ADD CONSTRAINT `core_user_custom_fields_ibfk_1` FOREIGN KEY (`id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_user_default_group`
--
ALTER TABLE `core_user_default_group`
ADD CONSTRAINT `core_user_default_group_ibfk_1` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `core_user_group`
--
ALTER TABLE `core_user_group`
ADD CONSTRAINT `core_user_group_ibfk_1` FOREIGN KEY (`groupId`) REFERENCES `core_group` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `core_user_group_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `davclient_calendar`
--
ALTER TABLE `davclient_calendar`
ADD CONSTRAINT `fk_davclient_calendar_calendarl` FOREIGN KEY (`id`) REFERENCES `calendar_calendar` (`id`),
ADD CONSTRAINT `fk_davclient_calendar_davaccount` FOREIGN KEY (`davaccountId`) REFERENCES `davclient_davaccount` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `davclient_davaccount`
--
ALTER TABLE `davclient_davaccount`
ADD CONSTRAINT `fk_davclient_davaccount_core_acl` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`);
--
-- Constraints for table `em_contacts_last_mail_times`
--
ALTER TABLE `em_contacts_last_mail_times`
ADD CONSTRAINT `em_contacts_last_mail_times_addressbook_addressbook_id_fk` FOREIGN KEY (`contact_id`) REFERENCES `addressbook_contact` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `em_contacts_last_mail_times_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `fs_bookmarks`
--
ALTER TABLE `fs_bookmarks`
ADD CONSTRAINT `fs_bookmarks_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fs_bookmarks_fs_folders_folder_id_fk` FOREIGN KEY (`folder_id`) REFERENCES `fs_folders` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `fs_files_custom_fields`
--
ALTER TABLE `fs_files_custom_fields`
ADD CONSTRAINT `fs_files_custom_fields_ibfk_1` FOREIGN KEY (`id`) REFERENCES `fs_files` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `fs_folders_custom_fields`
--
ALTER TABLE `fs_folders_custom_fields`
ADD CONSTRAINT `fs_folders_custom_fields_ibfk_1` FOREIGN KEY (`id`) REFERENCES `fs_folders` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `fs_trash`
--
ALTER TABLE `fs_trash`
ADD CONSTRAINT `fs_trash_ibfk_1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fs_trash_ibfk_2` FOREIGN KEY (`deletedBy`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fs_trash_ibfk_3` FOREIGN KEY (`entityTypeId`) REFERENCES `core_entity` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `go_state`
--
ALTER TABLE `go_state`
ADD CONSTRAINT `go_state_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `go_templates`
--
ALTER TABLE `go_templates`
ADD CONSTRAINT `fk_go_templates_go_template_group` FOREIGN KEY (`group_id`) REFERENCES `go_template_group` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `history_log_entry`
--
ALTER TABLE `history_log_entry`
ADD CONSTRAINT `fk_log_entry_core_acl1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- Constraints for table `notes_note`
--
ALTER TABLE `notes_note`
ADD CONSTRAINT `notes_note_ibfk_1` FOREIGN KEY (`noteBookId`) REFERENCES `notes_note_book` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `notes_note_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION,
ADD CONSTRAINT `notes_note_ibfk_3` FOREIGN KEY (`modifiedBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
--
-- Constraints for table `notes_note_book`
--
ALTER TABLE `notes_note_book`
ADD CONSTRAINT `notes_note_book_ibfk_1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `notes_note_book_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
--
-- Constraints for table `notes_note_custom_fields`
--
ALTER TABLE `notes_note_custom_fields`
ADD CONSTRAINT `notes_note_custom_fields_ibfk_1` FOREIGN KEY (`id`) REFERENCES `notes_note` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `notes_note_image`
--
ALTER TABLE `notes_note_image`
ADD CONSTRAINT `notes_note_image_ibfk_1` FOREIGN KEY (`blobId`) REFERENCES `core_blob` (`id`),
ADD CONSTRAINT `notes_note_image_ibfk_2` FOREIGN KEY (`noteId`) REFERENCES `notes_note` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `notes_user_settings`
--
ALTER TABLE `notes_user_settings`
ADD CONSTRAINT `notes_user_settings_ibfk_1` FOREIGN KEY (`defaultNoteBookId`) REFERENCES `notes_note_book` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `notes_user_settings_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `otp_secret`
--
ALTER TABLE `otp_secret`
ADD CONSTRAINT `otp_secret_user` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `su_latest_read_announcement_records`
--
ALTER TABLE `su_latest_read_announcement_records`
ADD CONSTRAINT `su_latest_read_announcement_records_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `su_latest_read_announcement_records_su_announcements_id_fk` FOREIGN KEY (`announcement_id`) REFERENCES `su_announcements` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `su_notes`
--
ALTER TABLE `su_notes`
ADD CONSTRAINT `su_notes_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `su_rss_feeds`
--
ALTER TABLE `su_rss_feeds`
ADD CONSTRAINT `su_rss_feeds_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `su_visible_calendars`
--
ALTER TABLE `su_visible_calendars`
ADD CONSTRAINT `su_visible_calendars_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `su_visible_lists`
--
ALTER TABLE `su_visible_lists`
ADD CONSTRAINT `su_visible_lists_core_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `sync_addressbook_user`
--
ALTER TABLE `sync_addressbook_user`
ADD CONSTRAINT `sync_addressbook_user_ibfk_1` FOREIGN KEY (`addressBookId`) REFERENCES `addressbook_addressbook` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `sync_addressbook_user_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `sync_tasklist_user`
--
ALTER TABLE `sync_tasklist_user`
ADD CONSTRAINT `sync_tasklist_user_core_user_id_fk` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `sync_tasklist_user_tasks_tasklist_id_fk` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `sync_user_note_book`
--
ALTER TABLE `sync_user_note_book`
ADD CONSTRAINT `sync_user_note_book_user` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tasks_alert`
--
ALTER TABLE `tasks_alert`
ADD CONSTRAINT `fk_tasks_alert_tasks_task_user1` FOREIGN KEY (`taskId`, `userId`) REFERENCES `tasks_task_user` (`taskId`, `userId`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `tasks_category`
--
ALTER TABLE `tasks_category`
ADD CONSTRAINT `tasks_category_ibfk_1` FOREIGN KEY (`ownerId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `tasks_category_tasklist_ibfk_9` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tasks_default_alert`
--
ALTER TABLE `tasks_default_alert`
ADD CONSTRAINT `fk_tasks_default_alert_tasks_tasklist1` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `tasks_portlet_tasklist`
--
ALTER TABLE `tasks_portlet_tasklist`
ADD CONSTRAINT `tasks_portlet_tasklist_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `tasks_portlet_tasklist_ibfk_2` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tasks_task`
--
ALTER TABLE `tasks_task`
ADD CONSTRAINT `tasks_task_core_user_id_fk` FOREIGN KEY (`responsibleUserId`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `tasks_task_fkModifiedBy` FOREIGN KEY (`modifiedBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `tasks_task_groupId` FOREIGN KEY (`groupId`) REFERENCES `tasks_tasklist_group` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
ADD CONSTRAINT `tasks_task_ibfk_1` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `tasks_task_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `tasks_vcalendar_blob` FOREIGN KEY (`vcalendarBlobId`) REFERENCES `core_blob` (`id`) ON UPDATE SET NULL;
--
-- Constraints for table `tasks_tasklist`
--
ALTER TABLE `tasks_tasklist`
ADD CONSTRAINT `tasks_tasklist_ibfk1` FOREIGN KEY (`aclId`) REFERENCES `core_acl` (`id`),
ADD CONSTRAINT `tasks_tasklist_ibfk2` FOREIGN KEY (`createdBy`) REFERENCES `core_user` (`id`),
ADD CONSTRAINT `tasks_tasklist_tasks_tasklist_grouping_null_fk` FOREIGN KEY (`groupingId`) REFERENCES `tasks_tasklist_grouping` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `tasks_tasklist_group`
--
ALTER TABLE `tasks_tasklist_group`
ADD CONSTRAINT `fk_tasks_column_tasks_tasklist1` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `tasks_tasklist_user`
--
ALTER TABLE `tasks_tasklist_user`
ADD CONSTRAINT `fk_tasks_tasklist_user_tasks_tasklist1` FOREIGN KEY (`tasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `tasks_task_category`
--
ALTER TABLE `tasks_task_category`
ADD CONSTRAINT `tasks_task_category_ibfk_1` FOREIGN KEY (`taskId`) REFERENCES `tasks_task` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `tasks_task_category_ibfk_2` FOREIGN KEY (`categoryId`) REFERENCES `tasks_category` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tasks_task_custom_fields`
--
ALTER TABLE `tasks_task_custom_fields`
ADD CONSTRAINT `fk_tasks_task_custom_field1` FOREIGN KEY (`id`) REFERENCES `tasks_task` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tasks_task_user`
--
ALTER TABLE `tasks_task_user`
ADD CONSTRAINT `fk_tasks_task_user_tasks_task1` FOREIGN KEY (`taskId`) REFERENCES `tasks_task` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `tasks_user_settings`
--
ALTER TABLE `tasks_user_settings`
ADD CONSTRAINT `tasks_user_settings_core_user_id_fk` FOREIGN KEY (`userId`) REFERENCES `core_user` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `tasks_user_settings_tasks_tasklist_id_fk` FOREIGN KEY (`defaultTasklistId`) REFERENCES `tasks_tasklist` (`id`) ON DELETE SET NULL;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;