messages.sql 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. -- --------------------------------------------------------
  2. --
  3. -- Table structure for table `messages`
  4. --
  5. -- Creation: Aug 20, 2015 at 10:03 PM
  6. --
  7. DROP TABLE IF EXISTS `messages`;
  8. CREATE TABLE IF NOT EXISTS `messages` (
  9. `id` int(10) NOT NULL,
  10. `u_id` int(10) NOT NULL,
  11. `i_id` int(10) DEFAULT NULL,
  12. `p_id` int(10) DEFAULT NULL,
  13. `subject` varchar(50) COLLATE utf8_bin NOT NULL,
  14. `message` text COLLATE utf8_bin NOT NULL,
  15. `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  16. `date_modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  18. --
  19. -- RELATIONS FOR TABLE `messages`:
  20. -- `u_id`
  21. -- `users` -> `id`
  22. -- `i_id`
  23. -- `issues` -> `id`
  24. -- `p_id`
  25. -- `projects` -> `id`
  26. --
  27. --
  28. -- Indexes for table `messages`
  29. --
  30. ALTER TABLE `messages`
  31. ADD PRIMARY KEY (`id`),
  32. ADD KEY `u_id` (`u_id`),
  33. ADD KEY `i_id` (`i_id`),
  34. ADD KEY `p_id` (`p_id`);
  35. --
  36. -- AUTO_INCREMENT for table `messages`
  37. --
  38. ALTER TABLE `messages`
  39. MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;