-- phpMyAdmin SQL Dump
-- version 5.2.1deb1+jammy2
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : dim. 17 mars 2024 à 15:14
-- Version du serveur : 10.6.16-MariaDB-0ubuntu0.22.04.1
-- Version de PHP : 8.1.2-1ubuntu2.14

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


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

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

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

--
-- Structure de la table `articles`
--

CREATE TABLE `articles` (
  `ID` int(12) NOT NULL,
  `title` varchar(255) NOT NULL,
  `creation_date` datetime NOT NULL DEFAULT current_timestamp(),
  `last_update` datetime NOT NULL DEFAULT current_timestamp(),
  `author` int(12) NOT NULL COMMENT 'users.ID',
  `classification` int(12) NOT NULL COMMENT 'confidential_levels.ID',
  `miniature` varchar(255) DEFAULT NULL,
  `resume` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `articles`
--

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

--
-- Structure de la table `confidential_levels`
--

CREATE TABLE `confidential_levels` (
  `ID` int(11) NOT NULL,
  `name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `confidential_levels`
--

INSERT INTO `confidential_levels` (`ID`, `name`) VALUES
(0, 'E59i-P (Public)'),
(10, 'E59i-M (Membres)'),
(20, 'E59i-R (Responsables)'),
(50, 'E59i-D (Direction)');

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

--
-- Structure de la table `roles`
--

CREATE TABLE `roles` (
  `ID` int(11) NOT NULL,
  `badge_svg` varchar(2047) NOT NULL,
  `role_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `roles`
--

INSERT INTO `roles` (`ID`, `badge_svg`, `role_name`) VALUES
(0, ' ', 'Non connecté'),
(1, '', 'Connecté'),
(10, '<svg class=\"certification\" viewBox=\"0 0 22 22\" aria-label=\"Compte certifié\" role=\"img\"><g><path fill=\"#67c6d3\" d=\"M11,0C4.92,0,0,4.92,0,11s4.92,11,11,11,11-4.92,11-11S17.08,0,11,0ZM16.81,9.3l-6.67,6.67c-.36.36-.95.36-1.32,0l-3.55-3.55c-.47-.47-.47-1.24,0-1.71.47-.47,1.24-.47,1.71,0l2.5,2.5,5.61-5.61c.47-.47,1.24-.47,1.71,0,.47.47.47,1.24,0,1.71Z\"></path></g></svg>', 'Membre'),
(20, '<svg class=\"certification\" viewBox=\"0 0 22 22\" aria-label=\"Compte certifié\" role=\"img\"><g><path fill=\"#b467d3\" d=\"M21.62,10.02l-.86-.95c-.31-.35-.44-.82-.34-1.28l.27-1.26c.16-.73-.26-1.46-.98-1.69l-1.22-.39c-.45-.14-.79-.49-.94-.94l-.39-1.22c-.23-.71-.96-1.13-1.69-.98l-1.26.27c-.46.1-.93-.03-1.28-.34l-.95-.86c-.55-.5-1.4-.5-1.95,0l-.95.86c-.35.31-.82.44-1.28.34l-1.26-.27c-.73-.16-1.46.26-1.69.98l-.39,1.22c-.14.45-.49.79-.94.94l-1.22.39c-.71.23-1.13.96-.98,1.69l.27,1.26c.1.46-.03.93-.34,1.28l-.86.95c-.5.55-.5,1.4,0,1.95l.86.95c.31.35.44.82.34,1.28l-.27,1.26c-.16.73.26,1.46.98,1.69l1.22.39c.45.14.79.49.94.94l.39,1.22c.23.71.96,1.13,1.69.98l1.26-.27c.46-.1.93.03,1.28.34l.95.86c.55.5,1.4.5,1.95,0l.95-.86c.35-.31.82-.44,1.28-.34l1.26.27c.73.16,1.46-.26,1.69-.98l.39-1.22c.14-.45.49-.79.94-.94l1.22-.39c.71-.23,1.13-.96.98-1.69l-.27-1.26c-.1-.46.03-.93.34-1.28l.86-.95c.5-.55.5-1.4,0-1.95ZM16.77,9.3l-6.67,6.67c-.36.36-.95.36-1.32,0l-3.55-3.55c-.47-.47-.47-1.24,0-1.71.47-.47,1.24-.47,1.71,0l2.5,2.5,5.61-5.61c.47-.47,1.24-.47,1.71,0,.47.47.47,1.24,0,1.71Z\"></path></g></svg>', 'Responsable'),
(50, '<svg class=\"certification\" viewBox=\"0 0 22 22\" aria-label=\"Compte certifié\" role=\"img\"><g><path fill=\"#d39367\" d=\"M21.75,9.92l-1.31-2.67c-.04-.09-.08-.19-.12-.28l-.96-2.81c-.25-.72-.81-1.28-1.52-1.52l-2.81-.96c-.1-.03-.19-.07-.28-.12L12.08.25c-.68-.33-1.48-.33-2.16,0l-2.67,1.31c-.09.04-.19.08-.28.12l-2.81.96c-.72.25-1.28.81-1.52,1.52l-.96,2.81c-.03.1-.07.19-.12.28L.25,9.92c-.33.68-.33,1.48,0,2.16l1.31,2.67c.04.09.08.19.12.28l.96,2.81c.25.72.81,1.28,1.52,1.52l2.81.96c.1.03.19.07.28.12l2.67,1.31c.68.33,1.48.33,2.16,0l2.67-1.31c.09-.04.19-.08.28-.12l2.81-.96c.72-.25,1.28-.81,1.52-1.52l.96-2.81c.03-.1.07-.19.12-.28l1.31-2.67c.33-.68.33-1.48,0-2.16ZM16.91,8.78l-6.84,6.83c-.37.37-.98.37-1.35,0l-3.64-3.64c-.48-.48-.48-1.27,0-1.76.48-.48,1.27-.48,1.76,0l2.56,2.56,5.76-5.76c.48-.48,1.27-.48,1.76,0,.48.48.48,1.27,0,1.76Z\"></path></g></svg>', 'Directeur');

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

--
-- Structure de la table `users`
--

CREATE TABLE `users` (
  `ID` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `creation_date` datetime NOT NULL DEFAULT current_timestamp(),
  `last_update` datetime NOT NULL DEFAULT current_timestamp(),
  `display_name` varchar(255) DEFAULT 'Guest',
  `role` int(12) NOT NULL DEFAULT 0 COMMENT 'roles.ID',
  `accreditation` int(12) NOT NULL DEFAULT 0 COMMENT 'confidential_levels.ID',
  `profile_picture` varchar(255) DEFAULT NULL,
  `banner` varchar(255) DEFAULT '',
  `bio` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Déchargement des données de la table `users`
--

INSERT INTO `users` (`ID`, `username`, `password`, `email`, `creation_date`, `last_update`, `display_name`, `role`, `accreditation`, `profile_picture`, `banner`, `bio`) VALUES
(0, 'deleted_user', '0', NULL, '2024-03-14 20:22:10', '2024-03-17 14:21:53', 'Deleted User', 1, 1, NULL, '', NULL),
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin@e59.fr', '2024-03-07 19:42:01', '2024-03-17 14:21:53', 'Administrateur', 50, 50, '/assets/pp/1.png', '/assets/banners/1.png', ''),
--
-- Index pour les tables déchargées
--

--
-- Index pour la table `articles`
--
ALTER TABLE `articles`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `confidential_levels`
--
ALTER TABLE `confidential_levels`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`ID`);

--
-- Index pour la table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`ID`);

--
-- AUTO_INCREMENT pour les tables déchargées
--

--
-- AUTO_INCREMENT pour la table `articles`
--
ALTER TABLE `articles`
  MODIFY `ID` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT pour la table `confidential_levels`
--
ALTER TABLE `confidential_levels`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51;

--
-- AUTO_INCREMENT pour la table `roles`
--
ALTER TABLE `roles`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;

--
-- AUTO_INCREMENT pour la table `users`
--
ALTER TABLE `users`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
