-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : lun. 03 mars 2025 à 08:23
-- Version du serveur : 8.2.0
-- Version de PHP : 8.3.0

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";

SET NAMES utf8mb4;
SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET CHARACTER SET utf8mb4;
SET COLLATION_CONNECTION='utf8mb4_general_ci';

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

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

DROP TABLE IF EXISTS `billets`;
CREATE TABLE `billets` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `titre` VARCHAR(255) NOT NULL,
  `contenu` TEXT NOT NULL,
  `date_post` DATETIME NOT NULL,
  `auteur_id` INT NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_8072A2F460BB6FE6` (`auteur_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO `billets` (`id`, `titre`, `contenu`, `date_post`, `auteur_id`) VALUES
(1, 'Ceci est un billet', 'ceci est son contenu', '2025-02-28 19:03:14', 1),
(2, 'test ', 'jambon beurre ', '2025-02-28 19:06:37', 1),
(5, 'Persona 4 golden', 'le meilleur jeu du monde', '2025-02-28 20:37:15', 1),
(6, 'La bouffe c\'est la vie', 'le poulet est le meilleur ingrédient inimaginable', '2025-02-28 21:56:01', 1),
(7, 'Test Caro', 'php devoir', '2025-02-28 21:56:13', 1),
(8, 'Spiderman 2', 'Miles et Peter VS Venom', '2025-02-28 23:50:28', 1);

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

-- Structure de la table `coms`
DROP TABLE IF EXISTS `coms`;
CREATE TABLE `coms` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `contenu` TEXT NOT NULL,
  `date_post` DATETIME NOT NULL,
  `auteur_id` INT NOT NULL,
  `billet_id` INT NOT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_F23191BE60BB6FE6` (`auteur_id`),
  KEY `IDX_F23191BE44973C78` (`billet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Données de la table `coms`
INSERT INTO `coms` (`id`, `contenu`, `date_post`, `auteur_id`, `billet_id`) VALUES
(1, 'yo', '2025-02-28 21:32:01', 1, 1),
(3, 'c\'est vrai', '2025-02-28 21:33:14', 1, 5),
(7, 'Chie Satonaka la GOAT', '2025-02-28 21:57:02', 5, 5),
(8, 'EVERY DAY YOUNG LIFE JUNESUUU', '2025-02-28 21:57:28', 5, 2),
(9, 'Kenshi Yonezu', '2025-02-28 21:57:44', 5, 1),
(11, 'Chat', '2025-02-28 23:33:57', 8, 1),
(12, 'Texte constructif', '2025-03-03 07:27:40', 5, 8);

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

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `login` VARCHAR(255) NOT NULL,
  `mdp` VARCHAR(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO `user` (`id`, `login`, `mdp`) VALUES
(1, 'Admin01', '$2y$10$y/C1KNOSXFH8/HYBARqLBePdO0RVXyjMymReMQY1alApmPr0PnfMK'),
(5, 'Colheen', '$2y$10$cPLgCneazfqeGbYGkT39auYMLrKX8NL51zpPfjl5FQvKEkz1GukHW'),
(6, 'Anthony', '$2y$10$EoVRhfPkHxblRzPd/2dzuOs/6sniMV6.xSf.5KF19HPVyu3J6MBLa'),
(8, 'test', '$2y$10$9tFp9ZbjdBg4yRc8skRHp.6d4v6uzMqzwO0.rUKZSQtMDzamgwniO');

COMMIT;

SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
