-- http://www.phpmyadmin.net
--
-- Client :  127.0.0.1
-- Généré le :  Lun 14 Décembre 2015 à 15:54
-- Version du serveur :  10.1.9-MariaDB
-- Version de PHP :  5.6.15




--
-- Base de données :  `conference`
--

-- --------------------------------------------------------

--
-- Structure de la table `categories`
--

CREATE TABLE `categories` (
  `id` int(4) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `categories`
--

INSERT INTO `categories` (`id`, `title`, `description`, `created_at`, `updated_at`) VALUES
(1, 'design pattern', '', '2015-12-14 11:54:35', '2015-12-14 11:54:35'),
(2, 'cache', '', '2015-12-14 11:54:35', '2015-12-14 11:54:35'),
(3, 'tests', '', '2015-12-14 11:54:35', '2015-12-14 11:54:35'),
(4, 'sécurité', '', '2015-12-14 11:54:35', '2015-12-14 11:54:35');

-- --------------------------------------------------------

--
-- Structure de la table `comments`
--

CREATE TABLE `comments` (
  `id` int(10) UNSIGNED NOT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `message` text COLLATE utf8_unicode_ci NOT NULL,
  `spam` tinyint(1) NOT NULL DEFAULT '0',
  `published_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `post_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `comments`
--

INSERT INTO `comments` (`id`, `email`, `message`, `spam`, `published_at`, `post_id`, `created_at`, `updated_at`) VALUES
(3, 'mollitia', 'Sit reiciendis illum similique delectus et. Fuga occaecati quia reiciendis nostrum rerum ut.', 0, '0000-00-00 00:00:00', 3, '2015-12-14 11:54:40', '2015-12-14 11:54:40'),
(5, 'omnis', 'Consequatur excepturi consequuntur voluptates et. Id est modi quibusdam deleniti accusantium.', 0, '0000-00-00 00:00:00', 2, '2015-12-14 11:54:40', '2015-12-14 11:54:40'),
(6, 'odit', 'Et libero a in ea velit dolor enim. Ipsa minima similique doloribus.', 0, '0000-00-00 00:00:00', 3, '2015-12-14 11:54:40', '2015-12-14 11:54:40');

-- --------------------------------------------------------

--
-- Structure de la table `images`
--

CREATE TABLE `images` (
  `id` int(10) UNSIGNED NOT NULL,
  `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `size` int(10) UNSIGNED NOT NULL,
  `type` enum('jpeg','png') COLLATE utf8_unicode_ci NOT NULL,
  `post_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `images`
--

INSERT INTO `images` (`id`, `filename`, `size`, `type`, `post_id`, `created_at`, `updated_at`) VALUES
(4, 'placeat', 1, 'jpeg', 3, '2015-12-14 11:54:41', '2015-12-14 11:54:41'),
(7, 'dignissimos', 8, 'jpeg', 3, '2015-12-14 11:54:41', '2015-12-14 11:54:41');

-- --------------------------------------------------------

--
-- Structure de la table `migrations`
--

CREATE TABLE `migrations` (
  `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `migrations`
--

INSERT INTO `migrations` (`migration`, `batch`) VALUES
('2014_10_12_100000_create_password_resets_table', 1),
('2015_10_27_091607_create_categories_table', 1),
('2015_10_27_092540_create_users_table', 1),
('2015_10_27_093337_create_posts_table', 1),
('2015_10_27_093857_create_tags_table', 1),
('2015_10_27_094256_create_comments_table', 1),
('2015_10_27_094556_create_images_table', 1),
('2015_10_29_142950_create_post_tag_table', 1);

-- --------------------------------------------------------

--
-- Structure de la table `posts`
--

CREATE TABLE `posts` (
  `id` int(4) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `extrait` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `content` text COLLATE utf8_unicode_ci NOT NULL,
  `published_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `status` enum('published','unpublished','draft','delete') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unpublished',
  `category_id` int(4) UNSIGNED DEFAULT NULL,
  `users_id` int(4) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `finished_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `posts`
--

INSERT INTO `posts` (`id`, `title`, `extrait`, `url`, `content`, `published_at`, `status`, `category_id`, `users_id`, `created_at`, `updated_at`, `finished_at`) VALUES
(1, 'Symfony Live Madrid 2014', 'SensioLabs Madrid is proud to announce the third edition of the exceptionally successful SymfonyLive Madrid.', 'http://berlin2014.live.symfony.com/ ', 'The two day conference will take place on Thursday 25th - Friday 26th September 2014, in the heart of Madrid, and will bring together the sharpest minds in open source enterprise software development. Day one is a workshop day consisting of hands-on training courses from industry leading Symfony experts. Day two is the main conference day when we''re pulling out all the stops. Talks on Symfony, Drupal, BDD and wider PHP topics will make this an event to remember. ', '2014-10-29 08:00:00', 'unpublished', 4, NULL, '2014-10-29 08:00:00', '2014-10-29 08:00:00', '2014-10-31 17:00:00'),
(2, 'Symfony Live London 2014', 'SensioLabs UK is proud to announce the third edition of the exceptionally successful SymfonyLive London. ', 'http://london2014.live.symfony.com/', 'The two day conference will take place on Thursday 25th - Friday 26th September 2014, in the heart of London, and will bring together the sharpest minds in open source enterprise software development. Day one is a workshop day consisting of hands-on training courses from industry leading Symfony experts. Day two is the main conference day when we''re pulling out all the stops. Talks on Symfony, Drupal, BDD and wider PHP topics will make this an event to remember. ', '2014-10-29 08:00:00', 'unpublished', 3, NULL, '2014-10-29 08:00:00', '2014-10-29 08:00:00', '2014-10-31 17:00:00'),
(3, 'Laracom Amsterdam 2014', 'The creator of Laravel gives a talk about building artisan commands, the IoC container, queues, testing, and some upcoming Laravel features. ', 'http://laracon.eu/2014/', 'The Community contributor Tony talks about his experiences writing large applications with Laravel 4 and his current architectural approaches.\r\nThe creator of Laravel gives a talk about building artisan commands, the IoC container, queues, testing, and some upcoming Laravel features.', '2014-10-29 08:00:00', 'unpublished', 1, NULL, '2014-10-29 08:00:00', '2014-10-29 08:00:00', '2014-10-31 17:00:00'),
(4, 'PHP Tour 2014', 'Cette année au PHP Tour Lyon 2014, l''AFUP et JoliCode, sponsor Argent, exaucent leur souhait ! Un apéro communautaire se tiendra le lundi 23 juin, uniquement réservé aux visiteurs de l''event, juste après la fin de la première journée de conférences. \r\n', 'http://afup.org/pages/phptourlyon2014/', 'C''est au Red House, pub situé à quelques pas de la Manufacture des Tabacs, que nous organiserons cet apéro PHP exceptionnel. Repas, boissons, ambiance conviviale, quelques surprises, on se charge de tout ! Et l''AFUP est soutenue dans l''organisation de cette soirée par JoliCode, agence experte dans la réalisation de projets Web et mobiles. En effet, JoliCode s''implique dans de nombreuses conférences à travers le monde, et a depuis toujours une véritable affinité avec les événements AFUP. Sans compter que les développeurs de JoliCode sont convaincus que, ce qu''il y a de mieux dans une conférence, ce sont les gens que l''on y croise et les discussions qui s''en suivent... C''est pourquoi, en plus de devenir sponsor Argent du PHP Tour Lyon 2014, JoliCode participe à l''organisation de cet apéro communautaire gratuit pour tous les visiteurs de l''event ! ', '2014-10-29 08:00:00', 'unpublished', 4, NULL, '2014-10-29 08:00:00', '2014-10-29 08:00:00', '2014-10-31 18:00:00');

-- --------------------------------------------------------

--
-- Structure de la table `post_tag`
--

CREATE TABLE `post_tag` (
  `post_id` int(4) UNSIGNED NOT NULL,
  `tag_id` int(4) UNSIGNED NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `post_tag`
--

INSERT INTO `post_tag` (`post_id`, `tag_id`, `created_at`, `updated_at`) VALUES
(2, 4, '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
(4, 2, '0000-00-00 00:00:00', '0000-00-00 00:00:00');

-- --------------------------------------------------------

--
-- Structure de la table `tags`
--

CREATE TABLE `tags` (
  `id` int(4) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Contenu de la table `tags`
--

INSERT INTO `tags` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'design pattern', '2015-12-14 11:54:40', '2015-12-14 11:54:40'),
(2, 'cache', '2015-12-14 11:54:40', '2015-12-14 11:54:40'),
(3, 'tests', '2015-12-14 11:54:40', '2015-12-14 11:54:40'),
(4, 'sécurité', '2015-12-14 11:54:40', '2015-12-14 11:54:40');

--
-- Index pour les tables exportées
--

--
-- Index pour la table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`);

--
-- Index pour la table `comments`
--
ALTER TABLE `comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `comments_post_id_foreign` (`post_id`);

--
-- Index pour la table `images`
--
ALTER TABLE `images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `images_post_id_foreign` (`post_id`);

--
-- Index pour la table `posts`
--
ALTER TABLE `posts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `posts_category_id_foreign` (`category_id`),
  ADD KEY `posts_users_id_foreign` (`users_id`);

--
-- Index pour la table `post_tag`
--
ALTER TABLE `post_tag`
  ADD KEY `post_tag_post_id_foreign` (`post_id`),
  ADD KEY `post_tag_tag_id_foreign` (`tag_id`);

--
-- Index pour la table `tags`
--
ALTER TABLE `tags`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT pour les tables exportées
--

--
-- AUTO_INCREMENT pour la table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT pour la table `comments`
--
ALTER TABLE `comments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT pour la table `images`
--
ALTER TABLE `images`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT pour la table `posts`
--
ALTER TABLE `posts`
  MODIFY `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT pour la table `tags`
--
ALTER TABLE `tags`
  MODIFY `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `comments`
--
ALTER TABLE `comments`
  ADD CONSTRAINT `comments_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `images`
--
ALTER TABLE `images`
  ADD CONSTRAINT `images_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE;

--
-- Contraintes pour la table `posts`
--
ALTER TABLE `posts`
  ADD CONSTRAINT `posts_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `posts_users_id_foreign` FOREIGN KEY (`users_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Contraintes pour la table `post_tag`
--
ALTER TABLE `post_tag`
  ADD CONSTRAINT `post_tag_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `post_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE;

