Skip to content
Snippets Groups Projects
Commit 3406a37a authored by theo's avatar theo
Browse files

correction sql

parent d9c50132
No related branches found
No related tags found
No related merge requests found
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Hôte : db
-- Généré le : lun. 09 nov. 2020 à 13:08
-- Version du serveur : 8.0.21
-- Version de PHP : 7.4.11
-- Host: db
-- Generation Time: Nov 10, 2020 at 09:13 AM
-- Server version: 8.0.22
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
......@@ -18,13 +18,13 @@ SET time_zone = "+00:00";
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `atelier`
-- Database: `atelier`
--
-- --------------------------------------------------------
--
-- Structure de la table `commentaire`
-- Table structure for table `commentaire`
--
CREATE TABLE `commentaire` (
......@@ -36,7 +36,7 @@ CREATE TABLE `commentaire` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Déchargement des données de la table `commentaire`
-- Dumping data for table `commentaire`
--
INSERT INTO `commentaire` (`id_commentaire`, `id_photo`, `id_user`, `content`, `date`) VALUES
......@@ -45,7 +45,7 @@ INSERT INTO `commentaire` (`id_commentaire`, `id_photo`, `id_user`, `content`, `
-- --------------------------------------------------------
--
-- Structure de la table `galerie`
-- Table structure for table `galerie`
--
CREATE TABLE `galerie` (
......@@ -58,7 +58,7 @@ CREATE TABLE `galerie` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Déchargement des données de la table `galerie`
-- Dumping data for table `galerie`
--
INSERT INTO `galerie` (`id_galerie`, `nom`, `description`, `type`, `motscles`, `date`) VALUES
......@@ -74,7 +74,34 @@ INSERT INTO `galerie` (`id_galerie`, `nom`, `description`, `type`, `motscles`, `
-- --------------------------------------------------------
--
-- Structure de la table `photos`
-- Table structure for table `groupe`
--
CREATE TABLE `groupe` (
`id_group` int NOT NULL,
`nom_group` varchar(20) DEFAULT NULL,
`id_admin` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `groupe`
--
INSERT INTO `groupe` (`id_group`, `nom_group`, `id_admin`) VALUES
(1, 'test', 5),
(6, 'retfhgjklm', 5),
(7, 'retfhgjklm', 5),
(8, 'qsdfrt', 5),
(9, 'qsdfrtdddddddddddddd', 5),
(10, '124568', 5),
(11, '8846585757545', 5),
(12, '8846585757545', 5),
(13, 'ezyqbzkezrih kd', 5);
-- --------------------------------------------------------
--
-- Table structure for table `photos`
--
CREATE TABLE `photos` (
......@@ -87,7 +114,7 @@ CREATE TABLE `photos` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Déchargement des données de la table `photos`
-- Dumping data for table `photos`
--
INSERT INTO `photos` (`id_photo`, `id_galerie`, `titre`, `imageUrl`, `motsCles`, `date`) VALUES
......@@ -103,7 +130,7 @@ INSERT INTO `photos` (`id_photo`, `id_galerie`, `titre`, `imageUrl`, `motsCles`,
-- --------------------------------------------------------
--
-- Structure de la table `user`
-- Table structure for table `user`
--
CREATE TABLE `user` (
......@@ -114,7 +141,7 @@ CREATE TABLE `user` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Déchargement des données de la table `user`
-- Dumping data for table `user`
--
INSERT INTO `user` (`id_user`, `nom`, `email`, `password`) VALUES
......@@ -125,7 +152,7 @@ INSERT INTO `user` (`id_user`, `nom`, `email`, `password`) VALUES
-- --------------------------------------------------------
--
-- Structure de la table `user_2_galerie`
-- Table structure for table `user_2_galerie`
--
CREATE TABLE `user_2_galerie` (
......@@ -135,7 +162,7 @@ CREATE TABLE `user_2_galerie` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Déchargement des données de la table `user_2_galerie`
-- Dumping data for table `user_2_galerie`
--
INSERT INTO `user_2_galerie` (`id_user`, `id_galerie`, `acces`) VALUES
......@@ -148,12 +175,32 @@ INSERT INTO `user_2_galerie` (`id_user`, `id_galerie`, `acces`) VALUES
(7, 10, 3),
(7, 11, 3);
-- --------------------------------------------------------
--
-- Index pour les tables déchargées
-- Table structure for table `user_2_group`
--
CREATE TABLE `user_2_group` (
`id_group` int NOT NULL,
`id_user` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `user_2_group`
--
INSERT INTO `user_2_group` (`id_group`, `id_user`) VALUES
(1, 7),
(13, 6),
(13, 7);
--
-- Index pour la table `commentaire`
-- Indexes for dumped tables
--
--
-- Indexes for table `commentaire`
--
ALTER TABLE `commentaire`
ADD PRIMARY KEY (`id_commentaire`),
......@@ -161,82 +208,116 @@ ALTER TABLE `commentaire`
ADD KEY `FK_id_photo2` (`id_photo`);
--
-- Index pour la table `galerie`
-- Indexes for table `galerie`
--
ALTER TABLE `galerie`
ADD PRIMARY KEY (`id_galerie`);
--
-- Index pour la table `photos`
-- Indexes for table `groupe`
--
ALTER TABLE `groupe`
ADD PRIMARY KEY (`id_group`),
ADD KEY `id_admin` (`id_admin`);
--
-- Indexes for table `photos`
--
ALTER TABLE `photos`
ADD PRIMARY KEY (`id_photo`),
ADD KEY `FK_id_galerie` (`id_galerie`);
--
-- Index pour la table `user`
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id_user`);
--
-- Index pour la table `user_2_galerie`
-- Indexes for table `user_2_galerie`
--
ALTER TABLE `user_2_galerie`
ADD PRIMARY KEY (`id_user`,`id_galerie`),
ADD KEY `FK_id_galerie1` (`id_galerie`);
--
-- AUTO_INCREMENT pour les tables déchargées
-- Indexes for table `user_2_group`
--
ALTER TABLE `user_2_group`
ADD PRIMARY KEY (`id_user`,`id_group`),
ADD KEY `id_group` (`id_group`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT pour la table `commentaire`
-- AUTO_INCREMENT for table `commentaire`
--
ALTER TABLE `commentaire`
MODIFY `id_commentaire` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
MODIFY `id_commentaire` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pour la table `galerie`
-- AUTO_INCREMENT for table `galerie`
--
ALTER TABLE `galerie`
MODIFY `id_galerie` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT pour la table `photos`
-- AUTO_INCREMENT for table `groupe`
--
ALTER TABLE `groupe`
MODIFY `id_group` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `photos`
--
ALTER TABLE `photos`
MODIFY `id_photo` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT pour la table `user`
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id_user` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- Contraintes pour les tables déchargées
-- Constraints for dumped tables
--
--
-- Contraintes pour la table `commentaire`
-- Constraints for table `commentaire`
--
ALTER TABLE `commentaire`
ADD CONSTRAINT `FK_id_photo2` FOREIGN KEY (`id_photo`) REFERENCES `photos` (`id_photo`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `FK_id_user2` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Contraintes pour la table `photos`
-- Constraints for table `groupe`
--
ALTER TABLE `groupe`
ADD CONSTRAINT `groupe_ibfk_1` FOREIGN KEY (`id_admin`) REFERENCES `user` (`id_user`);
--
-- Constraints for table `photos`
--
ALTER TABLE `photos`
ADD CONSTRAINT `FK_id_galerie` FOREIGN KEY (`id_galerie`) REFERENCES `galerie` (`id_galerie`);
--
-- Contraintes pour la table `user_2_galerie`
-- Constraints for table `user_2_galerie`
--
ALTER TABLE `user_2_galerie`
ADD CONSTRAINT `FK_id_galerie1` FOREIGN KEY (`id_galerie`) REFERENCES `galerie` (`id_galerie`),
ADD CONSTRAINT `FK_id_user1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`);
--
-- Constraints for table `user_2_group`
--
ALTER TABLE `user_2_group`
ADD CONSTRAINT `user_2_group_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`),
ADD CONSTRAINT `user_2_group_ibfk_2` FOREIGN KEY (`id_group`) REFERENCES `groupe` (`id_group`),
ADD CONSTRAINT `user_2_group_ibfk_3` FOREIGN KEY (`id_user`) REFERENCES `user` (`id_user`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment