-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 13, 2022 at 04:54 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21

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 */;

--
-- Database: `oliveiradasilvat_bibliomaniak`
--
CREATE DATABASE IF NOT EXISTS `oliveiradasilvat_bibliomaniak` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `oliveiradasilvat_bibliomaniak`;

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

--
-- Table structure for table `t_livre`
--

DROP TABLE IF EXISTS `t_livre`;
CREATE TABLE IF NOT EXISTS `t_livre` (
  `PK_Livre` int(11) NOT NULL AUTO_INCREMENT,
  `Title` text NOT NULL,
  `Author` text NOT NULL,
  `FK_Genre` int(11) NOT NULL,
  `FK_Login` int(11) NOT NULL,
  PRIMARY KEY (`PK_Livre`),
  KEY `FK_Genre` (`FK_Genre`),
  KEY `FK_Login` (`FK_Login`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `t_livre`
--

INSERT INTO `t_livre` (`PK_Livre`, `Title`, `Author`, `FK_Genre`, `FK_Login`) VALUES
(1, 'Docteur Sleep', 'Stephen King', 2,1),
(2, 'Godefroy de Bouillon', 'Pierre Aubé', 8,1),
(3, 'Eragon', 'Christopher Paolini', 4,1),
(4, 'Baudouin IV de Jérusalem', 'Pierre Aubé', 8,1),
(5, 'Alexis Ier Comnène', 'Elisabeth Malamut', 8,1),
(6, 'Les croisades vues par les Arabes', 'Amin Maalouf', 8,1),
(7, 'Les Assassins', 'Bernard Lewis', 8,1),
(8, 'Des Turcs', 'George de Hongrie', 8,1);

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

--
-- Table structure for table `t_genre`
--

DROP TABLE IF EXISTS `t_genre`;
CREATE TABLE IF NOT EXISTS `t_genre` (
  `PK_Genre` int(11) NOT NULL AUTO_INCREMENT,
  `Nom` text NOT NULL,
  PRIMARY KEY (`PK_Genre`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `t_genre`
--

INSERT INTO `t_genre` (`PK_Genre`, `Nom`) VALUES
(1, 'Thriller'),
(2, 'Horreur'),
(3, 'Amour'),
(4, 'Fantastique'),
(5, 'Action'),
(6, 'Policier'),
(7, 'SF'),
(8, 'Historique');

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

--
-- Table structure for table `t_login`
--

DROP TABLE IF EXISTS `t_login`;
CREATE TABLE IF NOT EXISTS `t_login` (
  `PK_Login` int(11) NOT NULL AUTO_INCREMENT,
  `Username` text NOT NULL,
  `Password` text NOT NULL,
  PRIMARY KEY (`PK_Login`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `t_login`
--

INSERT INTO `t_login` (`PK_Login`, `Username`, `Password`) VALUES
(1, 'tiago', '$2y$10$aPQIyBFVSuuash6lVT6cN.S/wiolf2fdhmBuWAUtr9aucfnp9K19e');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `t_livre`
--
ALTER TABLE `t_livre`
  ADD CONSTRAINT `t_livre_ibfk_1` FOREIGN KEY (`FK_Genre`) REFERENCES `t_genre` (`PK_Genre`),
  ADD CONSTRAINT `t_livre_ibfk_2` FOREIGN KEY (`FK_Login`) REFERENCES `t_login` (`PK_Login`);
  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 */;
