/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `node`
--

-- --------------------------------------------------------

--
-- Table structure for table `todo_category`
--

CREATE TABLE IF NOT EXISTS `todo_category` (
`id` int(11) NOT NULL,
  `title` varchar(128) NOT NULL,
  `description` text NOT NULL,
  `group_id` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_category`
--

INSERT INTO `todo_category` (`id`, `title`, `description`, `group_id`) VALUES
(1, 'Work', 'Tasks related to work', 0),
(2, 'Kanji Database', 'Tasks having to do with my Kanji database', 11),
(3, 'Tim''s CMS', '     Tasks related to Tim''s CMS     ', 11),
(4, 'Website', '     Tasks related to Tim''s Home Page itself     ', 11),
(7, 'Optional ', 'Tasks that are not necessary, but it would be nice to see them completed.', 0),
(9, 'Tim''s Todo', 'Tasks having to do with this application', 11),
(10, 'School', 'School related tasks', 0),
(11, 'Other', 'Tasks that don''t fit in another category.', 0),
(13, 'Personal', 'Personal tasks to do', 0),
(27, 'Bugfixes', 'Problems with Tim''s Todo<br>', 11),
(32, 'asfasdfhasjk', 'jkajhsdkfhkasjdnfklahskjasn work', 53);

-- --------------------------------------------------------

--
-- Table structure for table `todo_checklist`
--

CREATE TABLE IF NOT EXISTS `todo_checklist` (
`id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `description` varchar(128) NOT NULL,
  `is_checked` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=165 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_checklist`
--

INSERT INTO `todo_checklist` (`id`, `task_id`, `description`, `is_checked`) VALUES
(18, 97, 'Share this task', 1),
(23, 115, 'This checkbox should mark the task as started', 1),
(24, 115, 'This checkbox should mark the task as completed', 1),
(69, 136, 'Display individual tweets in overlay', 1),
(70, 136, 'Ajax page loading (similar to comic site)', 1),
(71, 136, 'Long term @anywhere login', 1),
(72, 136, 'Bind @anywhere login to custom tweet button', 1),
(73, 136, 'Disable refresh on single tweets', 1),
(77, 136, 'Put twitter post box in hidable overlay', 1),
(79, 136, 'Unshorten-urls in tweets', 1),
(83, 136, 'Fix individual tweet overlay to work after ajax page update', 1),
(101, 136, 'Fix loading bar, make it show and hide, rather than replacing it.', 1),
(103, 136, 'Fix url overlay - all links currently open in new tab', 1),
(109, 136, 'Direct Messaging', 1),
(111, 136, 'Add smiley parser to tweet processing', 1),
(112, 136, 'Tweet filtering by source and screenname', 0),
(113, 136, 'Client side templating', 1),
(117, 136, 'Client-side data manipulation', 1),
(118, 136, 'Client-side data access', 1),
(132, 151, 'Add task filtering by category', 0),
(133, 151, 'Add general task search', 0),
(134, 151, 'Remove remnants of social integration', 1),
(135, 151, 'Add password reset functionality', 0),
(136, 97, 'Allow un-sharing', 1),
(137, 151, 'Remove Old IE workarounds', 1),
(138, 151, 'Update Javascript Libraries', 1),
(139, 151, 'Reduce number of unneeded queries', 1),
(140, 151, 'Cleanup Javascript to be more readable', 1),
(141, 151, 'Fix task unsharing', 1),
(142, 151, 'Add Unit Tests', 1),
(143, 151, 'Add ability to edit comments', 0),
(144, 150, 'Sketch out initial interface', 0),
(145, 150, 'Decide technology stack', 0),
(146, 151, 'Remove add checklist item from ''checklist'' permission', 1),
(147, 151, 'Remove HMVC', 1),
(148, 153, 'Wake up', 0),
(149, 153, 'Drink Coffee', 0),
(150, 153, 'Stretch', 0),
(151, 151, 'Move JS to bottom of every page', 1),
(152, 151, 'Cut down on templating boilerplate', 1),
(153, 155, 'Determine how to reload OS', 0),
(154, 151, 'Fix SQL error on session timeout', 1),
(155, 151, 'Convert individual icons into a sprite', 1),
(156, 151, 'Add more visual confirmation to form submissions', 0),
(157, 151, 'Add CSRF Protection', 1),
(158, 151, 'Add pagination on all task views', 0),
(159, 151, 'Rename checklist column that is a reserved word', 1),
(160, 151, 'Get project working on Travis CI for mysql', 1),
(161, 151, 'Figure out why the hook does not redirect when the session expires', 0),
(162, 157, 'Task Validation', 0),
(163, 157, 'Password Validation', 0),
(164, 157, 'Registration Validation', 1);

-- --------------------------------------------------------

--
-- Table structure for table `todo_group`
--

CREATE TABLE IF NOT EXISTS `todo_group` (
`id` int(11) NOT NULL,
  `name` varchar(128) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_group`
--

INSERT INTO `todo_group` (`id`, `name`) VALUES
(1, 'global'),
(11, 'timw4mail'),
(53, 'guest'),
(65, 'guests');

-- --------------------------------------------------------

--
-- Table structure for table `todo_group_task_link`
--

CREATE TABLE IF NOT EXISTS `todo_group_task_link` (
  `group_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `permissions` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_group_task_link`
--

INSERT INTO `todo_group_task_link` (`group_id`, `task_id`, `permissions`) VALUES
(65, 151, 2);

-- --------------------------------------------------------

--
-- Table structure for table `todo_group_users_link`
--

CREATE TABLE IF NOT EXISTS `todo_group_users_link` (
  `group_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `is_admin` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_group_users_link`
--

INSERT INTO `todo_group_users_link` (`group_id`, `user_id`, `is_admin`) VALUES
(11, 1, 1),
(53, 3, 1),
(65, 3, 0);

-- --------------------------------------------------------

--
-- Table structure for table `todo_item`
--

CREATE TABLE IF NOT EXISTS `todo_item` (
`id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `category_id` int(11) NOT NULL,
  `priority` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  `title` varchar(128) NOT NULL,
  `description` text NOT NULL,
  `due` int(11) NOT NULL DEFAULT '0',
  `modified` int(11) NOT NULL,
  `created` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=158 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_item`
--

INSERT INTO `todo_item` (`id`, `user_id`, `category_id`, `priority`, `status`, `title`, `description`, `due`, `modified`, `created`) VALUES
(97, 1, 11, 5, 3, 'A task to share', 'This is a test of shared tasks. Feel free to comment.<br />', 0, 1406321577, 1287096417),
(100, 1, 9, 7, 2, 'Add user-specific task sharing', 'Add the ability to share tasks with individual users separate of groups.<br /><ul><li>Groups always have less priority than user settings.<br /></li></ul>', 1288062000, 1287709029, 1287419723),
(101, 1, 9, 5, 2, 'Edit/Delete task categories', 'Add the ability to edit or delete task categories that are private, and belong to the current user.<br>', 1287630000, 1287602597, 1287509051),
(115, 1, 9, 5, 2, 'Make checkboxes conditionally change status', '<ul><li>Checking the first checkbox in a list (the first one to be checked) should set the current task as "Work Started"</li><li>Checking the last unchecked item in the checklist should set the current task as "Task Completed"<br /></li></ul>', 1289271600, 1288736763, 1288629218),
(136, 1, 4, 5, 2, 'Twitter Client Improvements', 'Improve Twitter Client<br />', 0, 1404231369, 1297462883),
(150, 1, 13, 6, 1, 'Anime Collection App', 'Creation of an anime collection app.<br/><br/>Purposes:<br/><ul><li>Easy way to keep track of one''s collection</li><li>Searchable by title and aliases</li></ul><p>Features:</p><ul><li>User Accounts</li><li>Read-only guest access, or private access</li><li>Search / Organize by meta-data</li></ul>', 1412179200, 1406320382, 1404230822),
(151, 1, 9, 8, 3, 'Todo Improvements', 'Things to clean up, improve, fix or add to the todo app to make it better.<br />', 0, 1406321163, 1404231517),
(153, 3, 1, 5, 3, 'Get to work, Slacker!', 'Dude, you should be at work.', 1405083600, 0, 1405026719),
(155, 1, 13, 8, 5, 'Fix NAS Web Interface', 'Figure out a way to re-install the base OS without wiping the NAS data.<br/>', 1406347200, 1405603389, 1405467330),
(156, 3, 1, 5, 1, 'Lunch Appointment', 'Test', 1406304000, 0, 1406295432),
(157, 1, 9, 5, 3, 'Normalize Task validation', '<ul><li>Move custom validation to CI validation library</li><li>Move remaining logic to controllers as protected/private methods<br/></li></ul>', 0, 0, 1408390221);

-- --------------------------------------------------------

--
-- Table structure for table `todo_item_comments`
--

CREATE TABLE IF NOT EXISTS `todo_item_comments` (
`id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `comment` text NOT NULL,
  `time_posted` int(11) NOT NULL,
  `status` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=84 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_item_comments`
--

INSERT INTO `todo_item_comments` (`id`, `user_id`, `item_id`, `comment`, `time_posted`, `status`) VALUES
(65, 1, 136, 'Should I move auto-linking client-side?<br>', 1297465088, 1),
(66, 1, 136, 'I need to figure out a way to have multiple accounts simultaneously.<br>', 1301591198, 3),
(67, 1, 136, 'Worth looking into: last read synchronization.<br><br>http://www.manton.org/2011/06/tweetmarks.html<br>http://tweetmarks.net/<br>', 1307123852, 3),
(77, 1, 97, 'This is a shared comment.<br/>', 1404762189, 3),
(79, 1, 151, 'Problem Areas<br/><ul><li>Code Quality (Repetition, inappropriate class state)</li><li>SQL Queries (Inconsistent, repeditive, using php to join datasets)</li><li>Lack of Tests</li></ul>', 1404847061, 3),
(81, 1, 155, 'Apparently it fixed itself!<br/>', 1405603381, 1),
(83, 1, 151, 'Problem Areas (as of July 25, 2014)<br/><ul><li>Code Quality (Custom code for framework functionality)</li></ul>', 1406299699, 3);

-- --------------------------------------------------------

--
-- Table structure for table `todo_priority`
--

CREATE TABLE IF NOT EXISTS `todo_priority` (
`id` int(11) NOT NULL,
  `value` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_priority`
--

INSERT INTO `todo_priority` (`id`, `value`) VALUES
(1, 'Optional'),
(2, 'Lowest'),
(3, 'Lower'),
(4, 'Low'),
(5, 'Normal'),
(6, 'High'),
(7, 'Higher'),
(8, 'Highest'),
(9, 'Immediate');

-- --------------------------------------------------------

--
-- Table structure for table `todo_reminder`
--

CREATE TABLE IF NOT EXISTS `todo_reminder` (
`id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `reminder_time` int(11) NOT NULL,
  `sent` int(11) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `todo_status`
--

CREATE TABLE IF NOT EXISTS `todo_status` (
`id` int(11) NOT NULL,
  `value` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_status`
--

INSERT INTO `todo_status` (`id`, `value`) VALUES
(1, 'Created'),
(2, 'Completed'),
(3, 'In Progress'),
(4, 'On Hold'),
(5, 'Canceled');

-- --------------------------------------------------------

--
-- Stand-in structure for view `todo_task_view`
--
CREATE TABLE IF NOT EXISTS `todo_task_view` (
`id` int(11)
,`user_id` int(11)
,`category_id` int(11)
,`title` varchar(128)
,`due` int(11)
,`modified` int(11)
,`created` int(11)
,`category` varchar(128)
,`priority` varchar(255)
,`status` varchar(255)
,`status_id` int(11)
);
-- --------------------------------------------------------

--
-- Table structure for table `todo_user`
--

CREATE TABLE IF NOT EXISTS `todo_user` (
`id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `email` varchar(128) NOT NULL,
  `enabled` int(11) NOT NULL DEFAULT '1',
  `timezone` varchar(32) NOT NULL DEFAULT 'America/Detroit',
  `num_format` int(11) NOT NULL DEFAULT '0',
  `reset_token` varchar(128) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_user`
--

INSERT INTO `todo_user` (`id`, `username`, `password`, `email`, `enabled`, `timezone`, `num_format`, `reset_token`) VALUES
(1, 'timw4mail', '$2a$10$Ngb.PprkGi2daNIeyW5odOMkUqnqhdSBBgO.6idEspoQZfsH0QcQG', 'tim@timshomepage.net', 1, 'America/Detroit', 1, NULL),
(3, 'guest', '$2a$10$qW8HlbNDNEJx1GqmYW9APOYOqo5apV8stjNcV/xunsvnjTYJBTc0m', 'guest@timshomepage.net', 1, 'America/Detroit', 0, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `todo_user_friend_link`
--

CREATE TABLE IF NOT EXISTS `todo_user_friend_link` (
  `user_id` int(11) NOT NULL,
  `user_friend_id` int(11) NOT NULL,
  `confirmed` int(11) NOT NULL DEFAULT '-1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_user_friend_link`
--

INSERT INTO `todo_user_friend_link` (`user_id`, `user_friend_id`, `confirmed`) VALUES
(1, 3, 1);

-- --------------------------------------------------------

--
-- Table structure for table `todo_user_task_link`
--

CREATE TABLE IF NOT EXISTS `todo_user_task_link` (
  `user_id` int(11) NOT NULL,
  `task_id` int(11) NOT NULL,
  `permissions` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `todo_user_task_link`
--

INSERT INTO `todo_user_task_link` (`user_id`, `task_id`, `permissions`) VALUES
(1, 136, -1);

-- --------------------------------------------------------

--
-- Structure for view `todo_task_view`
--
DROP TABLE IF EXISTS `todo_task_view`;

CREATE ALGORITHM=UNDEFINED DEFINER=`node`@`localhost` SQL SECURITY DEFINER VIEW `todo_task_view` AS select `todo_item`.`id` AS `id`,`todo_item`.`user_id` AS `user_id`,`todo_item`.`category_id` AS `category_id`,`todo_item`.`title` AS `title`,`todo_item`.`due` AS `due`,`todo_item`.`modified` AS `modified`,`todo_item`.`created` AS `created`,`todo_category`.`title` AS `category`,`todo_priority`.`value` AS `priority`,`todo_status`.`value` AS `status`,`todo_status`.`id` AS `status_id` from (((`todo_item` left join `todo_category` on((`todo_category`.`id` = `todo_item`.`category_id`))) left join `todo_priority` on((`todo_priority`.`id` = `todo_item`.`priority`))) left join `todo_status` on((`todo_status`.`id` = `todo_item`.`status`))) order by `todo_item`.`due`,`todo_item`.`priority` desc,`todo_item`.`created`;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `todo_category`
--
ALTER TABLE `todo_category`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `todo_checklist`
--
ALTER TABLE `todo_checklist`
 ADD PRIMARY KEY (`id`), ADD KEY `task_id` (`task_id`);

--
-- Indexes for table `todo_group`
--
ALTER TABLE `todo_group`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `todo_group_task_link`
--
ALTER TABLE `todo_group_task_link`
 ADD PRIMARY KEY (`group_id`,`task_id`), ADD KEY `task_id` (`task_id`);

--
-- Indexes for table `todo_group_users_link`
--
ALTER TABLE `todo_group_users_link`
 ADD PRIMARY KEY (`group_id`,`user_id`), ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `todo_item`
--
ALTER TABLE `todo_item`
 ADD PRIMARY KEY (`id`), ADD KEY `category_id` (`category_id`), ADD KEY `priority` (`priority`), ADD KEY `status` (`status`), ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `todo_item_comments`
--
ALTER TABLE `todo_item_comments`
 ADD PRIMARY KEY (`id`), ADD KEY `item_id` (`item_id`), ADD KEY `status` (`status`), ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `todo_priority`
--
ALTER TABLE `todo_priority`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `todo_reminder`
--
ALTER TABLE `todo_reminder`
 ADD PRIMARY KEY (`id`), ADD KEY `task_id` (`task_id`), ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `todo_status`
--
ALTER TABLE `todo_status`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `todo_user`
--
ALTER TABLE `todo_user`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `todo_user_friend_link`
--
ALTER TABLE `todo_user_friend_link`
 ADD PRIMARY KEY (`user_id`,`user_friend_id`), ADD KEY `user_friend_id` (`user_friend_id`);

--
-- Indexes for table `todo_user_task_link`
--
ALTER TABLE `todo_user_task_link`
 ADD PRIMARY KEY (`task_id`,`user_id`), ADD KEY `user_id` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `todo_category`
--
ALTER TABLE `todo_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `todo_checklist`
--
ALTER TABLE `todo_checklist`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=165;
--
-- AUTO_INCREMENT for table `todo_group`
--
ALTER TABLE `todo_group`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=67;
--
-- AUTO_INCREMENT for table `todo_item`
--
ALTER TABLE `todo_item`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=158;
--
-- AUTO_INCREMENT for table `todo_item_comments`
--
ALTER TABLE `todo_item_comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=84;
--
-- AUTO_INCREMENT for table `todo_priority`
--
ALTER TABLE `todo_priority`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `todo_reminder`
--
ALTER TABLE `todo_reminder`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=43;
--
-- AUTO_INCREMENT for table `todo_status`
--
ALTER TABLE `todo_status`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `todo_user`
--
ALTER TABLE `todo_user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `todo_checklist`
--
ALTER TABLE `todo_checklist`
ADD CONSTRAINT `todo_checklist_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `todo_item` (`id`);

--
-- Constraints for table `todo_group_task_link`
--
ALTER TABLE `todo_group_task_link`
ADD CONSTRAINT `todo_group_task_link_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `todo_group` (`id`),
ADD CONSTRAINT `todo_group_task_link_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `todo_item` (`id`);

--
-- Constraints for table `todo_group_users_link`
--
ALTER TABLE `todo_group_users_link`
ADD CONSTRAINT `todo_group_users_link_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `todo_group` (`id`),
ADD CONSTRAINT `todo_group_users_link_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `todo_user` (`id`);

--
-- Constraints for table `todo_item`
--
ALTER TABLE `todo_item`
ADD CONSTRAINT `todo_item_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `todo_category` (`id`),
ADD CONSTRAINT `todo_item_ibfk_2` FOREIGN KEY (`priority`) REFERENCES `todo_priority` (`id`),
ADD CONSTRAINT `todo_item_ibfk_3` FOREIGN KEY (`status`) REFERENCES `todo_status` (`id`),
ADD CONSTRAINT `todo_item_ibfk_4` FOREIGN KEY (`user_id`) REFERENCES `todo_user` (`id`);

--
-- Constraints for table `todo_item_comments`
--
ALTER TABLE `todo_item_comments`
ADD CONSTRAINT `todo_item_comments_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `todo_item` (`id`),
ADD CONSTRAINT `todo_item_comments_ibfk_2` FOREIGN KEY (`status`) REFERENCES `todo_status` (`id`),
ADD CONSTRAINT `todo_item_comments_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `todo_user` (`id`);

--
-- Constraints for table `todo_reminder`
--
ALTER TABLE `todo_reminder`
ADD CONSTRAINT `todo_reminder_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `todo_item` (`id`),
ADD CONSTRAINT `todo_reminder_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `todo_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `todo_user_friend_link`
--
ALTER TABLE `todo_user_friend_link`
ADD CONSTRAINT `todo_user_friend_link_ibfk_1` FOREIGN KEY (`user_friend_id`) REFERENCES `todo_user` (`id`),
ADD CONSTRAINT `todo_user_friend_link_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `todo_user` (`id`);

--
-- Constraints for table `todo_user_task_link`
--
ALTER TABLE `todo_user_task_link`
ADD CONSTRAINT `todo_user_task_link_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `todo_item` (`id`),
ADD CONSTRAINT `todo_user_task_link_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `todo_user` (`id`);

/*!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 */;
