Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.18 KB | None | 0 0
  1.  
  2. --
  3. -- Base de données : `forum`
  4. --
  5.  
  6. -- --------------------------------------------------------
  7.  
  8. --
  9. -- Structure de la table `categories`
  10. --
  11.  
  12. CREATE TABLE `categories` (
  13. `Cat_id` int(11) NOT NULL,
  14. `Cat_titre` text NOT NULL,
  15. `Cat_description` text NOT NULL,
  16. `Cat_fk_categories` int(11) DEFAULT NULL
  17. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  18.  
  19. --
  20. -- Contenu de la table `categories`
  21. --
  22.  
  23. INSERT INTO `categories` (`Cat_id`, `Cat_titre`, `Cat_description`, `Cat_fk_categories`) VALUES
  24. (1, 'JAVA', 'Ensemble des Catégories et Sujets traitants de Java', NULL),
  25. (2, 'PHP', 'Ensemble des Categories et Sujets traitant de PHP', NULL),
  26. (3, 'Java EE', 'Sujet et categories traitant de Java EE', 1),
  27. (4, 'Java SE', 'Sujets et catégories traitants de java SE', 1),
  28. (5, 'Java Util', 'java utils', 3),
  29. (6, 'PHP 1', 'Le vieux php !', 2),
  30. (7, 'Python', 'Categories et sujets traitants de python', NULL),
  31. (8, 'SQL', 'Catégories et Sujets traitants de SQL', NULL),
  32. (9, 'PHP2', 'Catégories et Sujets traitants de PHP2', 2),
  33. (10, 'PYTHON1', 'Catégories et Sujets traitants de Python1', 7),
  34. (11, 'Python2', 'Catégories et Sujets traitants de Python2', 7),
  35. (12, 'SQL2', 'Catégories et Sujets traitants de SQL2', 8),
  36. (13, 'No-SQL', 'Catégories et Sujets traitants de No-SQL', 8),
  37. (14, 'My SQL', 'Catégories et Sujets traitants de My SQL', 12);
  38.  
  39. -- --------------------------------------------------------
  40.  
  41. --
  42. -- Structure de la table `messages`
  43. --
  44.  
  45. CREATE TABLE `messages` (
  46. `Mess_id` int(11) NOT NULL,
  47. `Mess_FK_Uti_id` int(11) NOT NULL,
  48. `Mess_FK_Suj_id` int(11) NOT NULL,
  49. `Mess_date` timestamp NOT NULL,
  50. `Mess_contenu` text NOT NULL
  51. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  52.  
  53. --
  54. -- Contenu de la table `messages`
  55. --
  56.  
  57. INSERT INTO `messages` (`Mess_id`, `Mess_FK_Uti_id`, `Mess_FK_Suj_id`, `Mess_date`, `Mess_contenu`) VALUES
  58. (1, 1, 1, '2017-07-05 18:55:56', 'Java c\'est super cool !'),
  59. (2, 1, 2, '2017-07-05 20:08:29', 'Trop nuuuuul!'),
  60. (3, 2, 3, '2017-07-05 21:46:25', 'oh oh !'),
  61. (4, 3, 3, '2017-07-05 21:58:10', 'What ?'),
  62. (5, 1, 3, '2017-07-05 22:05:08', ':/ ?');
  63.  
  64. -- --------------------------------------------------------
  65.  
  66. --
  67. -- Structure de la table `sujets`
  68. --
  69.  
  70. CREATE TABLE `sujets` (
  71. `Suj_id` int(11) NOT NULL,
  72. `Suj_titre` text NOT NULL,
  73. `Suj_description` text NOT NULL,
  74. `Suj_FK_Cat_id` bigint(20) NOT NULL,
  75. `Suj_FK_Uti_id` int(11) NOT NULL,
  76. `Suj_date` timestamp NOT NULL
  77. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  78.  
  79. --
  80. -- Contenu de la table `sujets`
  81. --
  82.  
  83. INSERT INTO `sujets` (`Suj_id`, `Suj_titre`, `Suj_description`, `Suj_FK_Cat_id`, `Suj_FK_Uti_id`, `Suj_date`) VALUES
  84. (1, 'Java c\'est bien !', 'Waoouuuwwww', 1, 1, '2017-07-05 18:50:09'),
  85. (2, 'Php c\'est pas super', 'pas super du tout', 2, 1, '2017-07-05 18:58:19'),
  86. (3, 'Sujet Java SE', 'Bla bla bla', 3, 3, '2017-07-05 21:45:24');
  87.  
  88. -- --------------------------------------------------------
  89.  
  90. --
  91. -- Structure de la table `utilisateurs`
  92. --
  93.  
  94. CREATE TABLE `utilisateurs` (
  95. `Uti_id` int(11) NOT NULL,
  96. `Uti_nom` varchar(50) NOT NULL,
  97. `Uti_prenom` varchar(50) NOT NULL,
  98. `Uti_mail` varchar(50) NOT NULL,
  99. `Uti_pseudo` varchar(30) NOT NULL,
  100. `Uti_admin` tinyint(1) DEFAULT NULL,
  101. `Uti_pwd` varchar(15) DEFAULT NULL,
  102. `Uti_datecreation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
  103. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  104.  
  105. --
  106. -- Contenu de la table `utilisateurs`
  107. --
  108.  
  109. INSERT INTO `utilisateurs` (`Uti_id`, `Uti_nom`, `Uti_prenom`, `Uti_mail`, `Uti_pseudo`, `Uti_admin`, `Uti_pwd`, `Uti_datecreation`) VALUES
  110. (1, 'LEONARD', 'Benjamin', 'benja.leonard.bl@gmail.com', 'Zead', 1, 'testforum', '2017-07-05 18:22:11'),
  111. (2, 'BAPS', 'Fabien', 'Baps.fabien@gmail.com', 'Bapsfan', NULL, '12345', '2017-07-05 21:30:52'),
  112. (3, 'SIQUET', 'Dylan', 'Dylan.siquet@gmail.com', 'Siq', NULL, '12345', '2017-07-05 21:32:39');
  113.  
  114. --
  115. -- Index pour les tables exportées
  116. --
  117.  
  118. --
  119. -- Index pour la table `categories`
  120. --
  121. ALTER TABLE `categories`
  122. ADD PRIMARY KEY (`Cat_id`),
  123. ADD KEY `Cat_FK_Cat_id` (`Cat_fk_categories`);
  124.  
  125. --
  126. -- Index pour la table `messages`
  127. --
  128. ALTER TABLE `messages`
  129. ADD PRIMARY KEY (`Mess_id`);
  130.  
  131. --
  132. -- Index pour la table `sujets`
  133. --
  134. ALTER TABLE `sujets`
  135. ADD PRIMARY KEY (`Suj_id`),
  136. ADD UNIQUE KEY `Suj_FK_Cat_id` (`Suj_FK_Cat_id`);
  137.  
  138. --
  139. -- Index pour la table `utilisateurs`
  140. --
  141. ALTER TABLE `utilisateurs`
  142. ADD PRIMARY KEY (`Uti_id`);
  143.  
  144. --
  145. -- AUTO_INCREMENT pour les tables exportées
  146. --
  147.  
  148. --
  149. -- AUTO_INCREMENT pour la table `categories`
  150. --
  151. ALTER TABLE `categories`
  152. MODIFY `Cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
  153. --
  154. -- AUTO_INCREMENT pour la table `messages`
  155. --
  156. ALTER TABLE `messages`
  157. MODIFY `Mess_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  158. --
  159. -- AUTO_INCREMENT pour la table `sujets`
  160. --
  161. ALTER TABLE `sujets`
  162. MODIFY `Suj_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  163. --
  164. -- AUTO_INCREMENT pour la table `utilisateurs`
  165. --
  166. ALTER TABLE `utilisateurs`
  167. MODIFY `Uti_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  168. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  169. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  170. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement