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: Nov 18, 2013 at 07:31 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 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 07, 2013 at 07:42 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=1 ;
  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: Nov 18, 2013 at 06:30 PM
  46. --
  47. DROP TABLE IF EXISTS `messages`;
  48. CREATE TABLE IF NOT EXISTS `messages` (
  49. `id` int(100) NOT NULL AUTO_INCREMENT,
  50. `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  51. `from_id` int(100) NOT NULL,
  52. `to_id` int(100) DEFAULT NULL,
  53. `p_id` int(11) DEFAULT NULL,
  54. `s_id` int(100) DEFAULT NULL,
  55. `i_id` int(100) DEFAULT NULL,
  56. `message` text NOT NULL,
  57. PRIMARY KEY (`id`),
  58. KEY `from_id` (`from_id`,`to_id`,`s_id`,`i_id`),
  59. KEY `to_id` (`to_id`),
  60. KEY `s_id` (`s_id`),
  61. KEY `i_id` (`i_id`),
  62. KEY `p_id` (`p_id`)
  63. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  64. --
  65. -- RELATIONS FOR TABLE `messages`:
  66. -- `from_id`
  67. -- `users` -> `id`
  68. -- `to_id`
  69. -- `users` -> `id`
  70. -- `s_id`
  71. -- `scrums` -> `id`
  72. -- `i_id`
  73. -- `issues` -> `id`
  74. -- `p_id`
  75. -- `projects` -> `id`
  76. --
  77. -- --------------------------------------------------------
  78. --
  79. -- Table structure for table `projects`
  80. --
  81. -- Creation: Oct 24, 2013 at 04:53 PM
  82. --
  83. DROP TABLE IF EXISTS `projects`;
  84. CREATE TABLE IF NOT EXISTS `projects` (
  85. `id` int(100) NOT NULL AUTO_INCREMENT,
  86. `u_id` int(100) NOT NULL,
  87. `title` varchar(100) NOT NULL,
  88. `description` text NOT NULL,
  89. PRIMARY KEY (`id`),
  90. KEY `u_id` (`u_id`)
  91. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  92. --
  93. -- RELATIONS FOR TABLE `projects`:
  94. -- `u_id`
  95. -- `users` -> `id`
  96. --
  97. -- --------------------------------------------------------
  98. --
  99. -- Table structure for table `rels`
  100. --
  101. -- Creation: Oct 07, 2013 at 07:42 PM
  102. --
  103. DROP TABLE IF EXISTS `rels`;
  104. CREATE TABLE IF NOT EXISTS `rels` (
  105. `id` int(11) NOT NULL AUTO_INCREMENT,
  106. `u_id` int(11) NOT NULL,
  107. `i_id` int(11) DEFAULT NULL,
  108. `s_id` int(11) DEFAULT NULL,
  109. PRIMARY KEY (`id`),
  110. KEY `u_id` (`u_id`,`i_id`,`s_id`),
  111. KEY `i_id` (`i_id`),
  112. KEY `s_id` (`s_id`)
  113. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  114. --
  115. -- RELATIONS FOR TABLE `rels`:
  116. -- `u_id`
  117. -- `users` -> `id`
  118. -- `i_id`
  119. -- `issues` -> `id`
  120. -- `s_id`
  121. -- `scrums` -> `id`
  122. --
  123. -- --------------------------------------------------------
  124. --
  125. -- Table structure for table `scrums`
  126. --
  127. -- Creation: Oct 07, 2013 at 07:42 PM
  128. --
  129. DROP TABLE IF EXISTS `scrums`;
  130. CREATE TABLE IF NOT EXISTS `scrums` (
  131. `id` int(100) NOT NULL AUTO_INCREMENT,
  132. `p_id` int(100) NOT NULL,
  133. `u_id` int(100) NOT NULL,
  134. `title` varchar(100) NOT NULL,
  135. `description` text NOT NULL,
  136. PRIMARY KEY (`id`),
  137. KEY `u_id` (`u_id`),
  138. KEY `p_id` (`p_id`)
  139. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  140. --
  141. -- RELATIONS FOR TABLE `scrums`:
  142. -- `u_id`
  143. -- `users` -> `id`
  144. -- `p_id`
  145. -- `projects` -> `id`
  146. --
  147. -- --------------------------------------------------------
  148. --
  149. -- Table structure for table `users`
  150. --
  151. -- Creation: Oct 07, 2013 at 07:42 PM
  152. --
  153. DROP TABLE IF EXISTS `users`;
  154. CREATE TABLE IF NOT EXISTS `users` (
  155. `id` int(11) NOT NULL AUTO_INCREMENT,
  156. `name` varchar(50) NOT NULL,
  157. `email` varchar(254) NOT NULL,
  158. `password` varchar(128) NOT NULL,
  159. `salt` varchar(25) NOT NULL,
  160. `key` varchar(128) NOT NULL,
  161. PRIMARY KEY (`id`),
  162. UNIQUE KEY `name` (`name`)
  163. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;
  164. --
  165. -- Constraints for dumped tables
  166. --
  167. --
  168. -- Constraints for table `issues`
  169. --
  170. ALTER TABLE `issues`
  171. ADD CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  172. ADD CONSTRAINT `issues_ibfk_2` FOREIGN KEY (`s_id`) REFERENCES `scrums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  173. --
  174. -- Constraints for table `messages`
  175. --
  176. ALTER TABLE `messages`
  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. ADD CONSTRAINT `messages_ibfk_5` FOREIGN KEY (`p_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  182. --
  183. -- Constraints for table `projects`
  184. --
  185. ALTER TABLE `projects`
  186. ADD CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  187. --
  188. -- Constraints for table `rels`
  189. --
  190. ALTER TABLE `rels`
  191. ADD CONSTRAINT `rels_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  192. ADD CONSTRAINT `rels_ibfk_2` FOREIGN KEY (`i_id`) REFERENCES `issues` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  193. ADD CONSTRAINT `rels_ibfk_3` FOREIGN KEY (`s_id`) REFERENCES `scrums` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  194. --
  195. -- Constraints for table `scrums`
  196. --
  197. ALTER TABLE `scrums`
  198. ADD CONSTRAINT `scrums_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  199. ADD CONSTRAINT `scrums_ibfk_2` FOREIGN KEY (`p_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  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 */;