issues.sql 1.2 KB

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