install.sql 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.0.4.1
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Host: 127.0.0.1
  6. -- Generation Time: Nov 25, 2013 at 10:20 PM
  7. -- Server version: 5.6.11
  8. -- PHP Version: 5.5.3
  9. SET FOREIGN_KEY_CHECKS=0;
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET AUTOCOMMIT = 0;
  12. START TRANSACTION;
  13. SET time_zone = "+00:00";
  14. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  15. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  16. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  17. /*!40101 SET NAMES utf8 */;
  18. -- --------------------------------------------------------
  19. --
  20. -- Table structure for table `issues`
  21. --
  22. -- Creation: Oct 07, 2013 at 07:42 PM
  23. --
  24. DROP TABLE IF EXISTS `issues`;
  25. CREATE TABLE IF NOT EXISTS `issues` (
  26. `id` int(100) NOT NULL AUTO_INCREMENT,
  27. `u_id` int(100) NOT NULL,
  28. `s_id` int(100) DEFAULT NULL,
  29. `title` varchar(100) NOT NULL,
  30. `description` text NOT NULL,
  31. PRIMARY KEY (`id`),
  32. KEY `u_id` (`u_id`),
  33. KEY `u_id_2` (`u_id`),
  34. KEY `s_id` (`s_id`)
  35. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  36. --
  37. -- RELATIONS FOR TABLE `issues`:
  38. -- `u_id`
  39. -- `users` -> `id`
  40. -- `s_id`
  41. -- `scrums` -> `id`
  42. --
  43. -- --------------------------------------------------------
  44. --
  45. -- Table structure for table `messages`
  46. --
  47. -- Creation: Nov 18, 2013 at 06:30 PM
  48. --
  49. DROP TABLE IF EXISTS `messages`;
  50. CREATE TABLE IF NOT EXISTS `messages` (
  51. `id` int(100) NOT NULL AUTO_INCREMENT,
  52. `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  53. `from_id` int(100) NOT NULL,
  54. `to_id` int(100) DEFAULT NULL,
  55. `p_id` int(11) DEFAULT NULL,
  56. `s_id` int(100) DEFAULT NULL,
  57. `i_id` int(100) DEFAULT NULL,
  58. `message` text NOT NULL,
  59. PRIMARY KEY (`id`),
  60. KEY `from_id` (`from_id`,`to_id`,`s_id`,`i_id`),
  61. KEY `to_id` (`to_id`),
  62. KEY `s_id` (`s_id`),
  63. KEY `i_id` (`i_id`),
  64. KEY `p_id` (`p_id`)
  65. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
  66. --
  67. -- RELATIONS FOR TABLE `messages`:
  68. -- `from_id`
  69. -- `users` -> `id`
  70. -- `to_id`
  71. -- `users` -> `id`
  72. -- `s_id`
  73. -- `scrums` -> `id`
  74. -- `i_id`
  75. -- `issues` -> `id`
  76. -- `p_id`
  77. -- `projects` -> `id`
  78. --
  79. -- --------------------------------------------------------
  80. --
  81. -- Table structure for table `projects`
  82. --
  83. -- Creation: Oct 24, 2013 at 04:53 PM
  84. --
  85. DROP TABLE IF EXISTS `projects`;
  86. CREATE TABLE IF NOT EXISTS `projects` (
  87. `id` int(100) NOT NULL AUTO_INCREMENT,
  88. `u_id` int(100) NOT NULL,
  89. `title` varchar(100) NOT NULL,
  90. `description` text NOT NULL,
  91. PRIMARY KEY (`id`),
  92. KEY `u_id` (`u_id`)
  93. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  94. --
  95. -- RELATIONS FOR TABLE `projects`:
  96. -- `u_id`
  97. -- `users` -> `id`
  98. --
  99. -- --------------------------------------------------------
  100. --
  101. -- Table structure for table `rels`
  102. --
  103. -- Creation: Oct 07, 2013 at 07:42 PM
  104. --
  105. DROP TABLE IF EXISTS `rels`;
  106. CREATE TABLE IF NOT EXISTS `rels` (
  107. `id` int(11) NOT NULL AUTO_INCREMENT,
  108. `u_id` int(11) NOT NULL,
  109. `i_id` int(11) DEFAULT NULL,
  110. `s_id` int(11) DEFAULT NULL,
  111. PRIMARY KEY (`id`),
  112. KEY `u_id` (`u_id`,`i_id`,`s_id`),
  113. KEY `i_id` (`i_id`),
  114. KEY `s_id` (`s_id`)
  115. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  116. --
  117. -- RELATIONS FOR TABLE `rels`:
  118. -- `u_id`
  119. -- `users` -> `id`
  120. -- `i_id`
  121. -- `issues` -> `id`
  122. -- `s_id`
  123. -- `scrums` -> `id`
  124. --
  125. -- --------------------------------------------------------
  126. --
  127. -- Table structure for table `scrums`
  128. --
  129. -- Creation: Oct 07, 2013 at 07:42 PM
  130. --
  131. DROP TABLE IF EXISTS `scrums`;
  132. CREATE TABLE IF NOT EXISTS `scrums` (
  133. `id` int(100) NOT NULL AUTO_INCREMENT,
  134. `p_id` int(100) NOT NULL,
  135. `u_id` int(100) NOT NULL,
  136. `title` varchar(100) NOT NULL,
  137. `description` text NOT NULL,
  138. PRIMARY KEY (`id`),
  139. KEY `u_id` (`u_id`),
  140. KEY `p_id` (`p_id`)
  141. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  142. --
  143. -- RELATIONS FOR TABLE `scrums`:
  144. -- `u_id`
  145. -- `users` -> `id`
  146. -- `p_id`
  147. -- `projects` -> `id`
  148. --
  149. -- --------------------------------------------------------
  150. --
  151. -- Table structure for table `users`
  152. --
  153. -- Creation: Nov 25, 2013 at 05:32 PM
  154. --
  155. DROP TABLE IF EXISTS `users`;
  156. CREATE TABLE IF NOT EXISTS `users` (
  157. `id` int(11) NOT NULL AUTO_INCREMENT,
  158. `name` varchar(50) NOT NULL,
  159. `email` varchar(254) NOT NULL,
  160. `password` varchar(128) NOT NULL,
  161. `salt` varchar(25) NOT NULL,
  162. `key` varchar(128) NOT NULL,
  163. `last_pm_check` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  164. PRIMARY KEY (`id`),
  165. UNIQUE KEY `name` (`name`)
  166. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;
  167. --
  168. -- Constraints for dumped tables
  169. --
  170. --
  171. -- Constraints for table `issues`
  172. --
  173. ALTER TABLE `issues`
  174. ADD CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  175. ADD CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`s_id`) REFERENCES `scrums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  176. --
  177. -- Constraints for table `messages`
  178. --
  179. ALTER TABLE `messages`
  180. ADD CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`from_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  181. ADD CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`to_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
  182. ADD CONSTRAINT `messages_ibfk_3` FOREIGN KEY (`s_id`) REFERENCES `scrums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  183. ADD CONSTRAINT `messages_ibfk_4` FOREIGN KEY (`i_id`) REFERENCES `issues` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  184. ADD CONSTRAINT `messages_ibfk_5` FOREIGN KEY (`p_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  185. --
  186. -- Constraints for table `projects`
  187. --
  188. ALTER TABLE `projects`
  189. ADD CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  190. --
  191. -- Constraints for table `rels`
  192. --
  193. ALTER TABLE `rels`
  194. ADD CONSTRAINT `rels_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  195. ADD CONSTRAINT `rels_ibfk_2` FOREIGN KEY (`i_id`) REFERENCES `issues` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  196. ADD CONSTRAINT `rels_ibfk_3` FOREIGN KEY (`s_id`) REFERENCES `scrums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  197. --
  198. -- Constraints for table `scrums`
  199. --
  200. ALTER TABLE `scrums`
  201. ADD CONSTRAINT `scrums_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  202. ADD CONSTRAINT `scrums_ibfk_2` FOREIGN KEY (`p_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  203. SET FOREIGN_KEY_CHECKS=1;
  204. COMMIT;
  205. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  206. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  207. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;