· 7 years ago · Sep 12, 2018, 06:38 PM
1-- phpMyAdmin SQL Dump
2-- version 4.4.15.9
3-- https://www.phpmyadmin.net
4--
5-- Client : localhost
6-- Généré le : Mer 12 Septembre 2018 à 18:33
7-- Version du serveur : 5.6.37
8-- Version de PHP : 5.6.31
9
10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11SET time_zone = "+00:00";
12
13
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 utf8mb4 */;
18
19--
20-- Base de données : `cakeCMS`
21--
22
23-- --------------------------------------------------------
24
25--
26-- Structure de la table `articles`
27--
28
29CREATE TABLE IF NOT EXISTS `articles` (
30 `id` int(11) NOT NULL,
31 `user_id` int(11) NOT NULL,
32 `title` varchar(255) NOT NULL,
33 `slug` varchar(191) NOT NULL,
34 `body` text,
35 `published` tinyint(1) DEFAULT '0',
36 `created` datetime DEFAULT NULL,
37 `modified` datetime DEFAULT NULL
38) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
39
40--
41-- Contenu de la table `articles`
42--
43
44INSERT INTO `articles` (`id`, `user_id`, `title`, `slug`, `body`, `published`, `created`, `modified`) VALUES
45(1, 1, 'First Post', 'first-post', 'This is the first post.', 1, '2018-08-23 09:23:31', '2018-08-23 09:23:31'),
46(2, 1, 'Nouvel article', 'Nouvel article', 'corps du nouvel arcticle', 0, '2018-08-23 14:49:12', '2018-08-23 14:49:12');
47
48-- --------------------------------------------------------
49
50--
51-- Structure de la table `articles_tags`
52--
53
54CREATE TABLE IF NOT EXISTS `articles_tags` (
55 `article_id` int(11) NOT NULL,
56 `tag_id` int(11) NOT NULL
57) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
58
59-- --------------------------------------------------------
60
61--
62-- Structure de la table `comments`
63--
64
65CREATE TABLE IF NOT EXISTS `comments` (
66 `id` int(11) NOT NULL,
67 `article_id` int(11) NOT NULL,
68 `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
69 `comment` text COLLATE utf8_unicode_ci NOT NULL,
70 `created` datetime NOT NULL,
71 `modified` datetime NOT NULL
72) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
73
74-- --------------------------------------------------------
75
76--
77-- Structure de la table `tags`
78--
79
80CREATE TABLE IF NOT EXISTS `tags` (
81 `id` int(11) NOT NULL,
82 `title` varchar(191) DEFAULT NULL,
83 `created` datetime DEFAULT NULL,
84 `modified` datetime DEFAULT NULL
85) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
86
87-- --------------------------------------------------------
88
89--
90-- Structure de la table `users`
91--
92
93CREATE TABLE IF NOT EXISTS `users` (
94 `id` int(11) NOT NULL,
95 `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
96 `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
97 `created` datetime DEFAULT NULL,
98 `modified` datetime DEFAULT NULL
99) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
100
101--
102-- Contenu de la table `users`
103--
104
105INSERT INTO `users` (`id`, `email`, `password`, `created`, `modified`) VALUES
106(1, 'cakephp@example.com', '$2y$10$LArsh3IMr1a3Kv/.f/W2KeVX/AQnpQQ/M.jBe38St5esu2vSRAEBa', '2018-08-23 09:23:31', '2018-08-23 09:23:31');
107
108--
109-- Index pour les tables exportées
110--
111
112--
113-- Index pour la table `articles`
114--
115ALTER TABLE `articles`
116 ADD PRIMARY KEY (`id`),
117 ADD UNIQUE KEY `slug` (`slug`),
118 ADD KEY `user_key` (`user_id`);
119
120--
121-- Index pour la table `articles_tags`
122--
123ALTER TABLE `articles_tags`
124 ADD PRIMARY KEY (`article_id`,`tag_id`),
125 ADD KEY `tag_key` (`tag_id`);
126
127--
128-- Index pour la table `comments`
129--
130ALTER TABLE `comments`
131 ADD PRIMARY KEY (`id`),
132 ADD KEY `article_id` (`article_id`);
133
134--
135-- Index pour la table `tags`
136--
137ALTER TABLE `tags`
138 ADD PRIMARY KEY (`id`),
139 ADD UNIQUE KEY `title` (`title`);
140
141--
142-- Index pour la table `users`
143--
144ALTER TABLE `users`
145 ADD PRIMARY KEY (`id`);
146
147--
148-- AUTO_INCREMENT pour les tables exportées
149--
150
151--
152-- AUTO_INCREMENT pour la table `articles`
153--
154ALTER TABLE `articles`
155 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
156--
157-- AUTO_INCREMENT pour la table `tags`
158--
159ALTER TABLE `tags`
160 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
161--
162-- AUTO_INCREMENT pour la table `users`
163--
164ALTER TABLE `users`
165 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
166--
167-- Contraintes pour les tables exportées
168--
169
170--
171-- Contraintes pour la table `articles`
172--
173ALTER TABLE `articles`
174 ADD CONSTRAINT `articles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
175
176--
177-- Contraintes pour la table `articles_tags`
178--
179ALTER TABLE `articles_tags`
180 ADD CONSTRAINT `articles_tags_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`),
181 ADD CONSTRAINT `articles_tags_ibfk_2` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`);
182
183--
184-- Contraintes pour la table `comments`
185--
186ALTER TABLE `comments`
187 ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`);
188
189/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
190/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
191/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;