install.sql 6.4 KB

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