Initial commit
This commit is contained in:
1 parent
ac59bcc9fa
commit
094972f4c0
262 files changed
+151168
No files matched your search
@@ -0,0 +1,632 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 4.8.3
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: 127.0.0.1
|
||||
-- Generation Time: Nov 22, 2018 at 09:53 PM
|
||||
-- Server version: 10.1.37-MariaDB
|
||||
-- PHP Version: 7.1.24
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET AUTOCOMMIT = 0;
|
||||
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: `dietetique_2`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `access_token`
|
||||
--
|
||||
|
||||
CREATE TABLE `access_token` (
|
||||
`id` int(11) NOT NULL,
|
||||
`id_compte` int(11) NOT NULL,
|
||||
`selector` char(16) COLLATE utf8_bin NOT NULL,
|
||||
`token` char(64) COLLATE utf8_bin NOT NULL,
|
||||
`expires` datetime NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `categorie`
|
||||
--
|
||||
|
||||
CREATE TABLE `categorie` (
|
||||
`id_categorie` int(11) NOT NULL,
|
||||
`nom` varchar(255) COLLATE utf8_bin NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
|
||||
|
||||
--
|
||||
-- Dumping data for table `categorie`
|
||||
--
|
||||
|
||||
INSERT INTO `categorie` (`id_categorie`, `nom`) VALUES
|
||||
(1, 'Fruits et Légumes'),
|
||||
(2, 'Viandes');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `commandes`
|
||||
--
|
||||
|
||||
CREATE TABLE `commandes` (
|
||||
`id_commande` int(11) NOT NULL,
|
||||
`id_compte` int(11) NOT NULL,
|
||||
`date` datetime NOT NULL,
|
||||
`status` char(1) COLLATE utf8_bin NOT NULL,
|
||||
`prix_total` decimal(5,3) NOT NULL,
|
||||
`trace_paiement` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
|
||||
|
||||
--
|
||||
-- Triggers `commandes`
|
||||
--
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `tai_commandes` AFTER INSERT ON `commandes` FOR EACH ROW begin
|
||||
|
||||
declare v_nom varchar(255);
|
||||
declare v_prenom varchar(255);
|
||||
declare v_courriel varchar(255);
|
||||
|
||||
select c.nom, c.prenom, c.courriel into v_nom, v_prenom, v_courriel
|
||||
from comptes c
|
||||
where c.id_compte = new.id_compte;
|
||||
|
||||
insert into historiquecommande
|
||||
values (0,
|
||||
new.id_commande,
|
||||
new.id_compte,
|
||||
v_nom,
|
||||
v_prenom,
|
||||
v_courriel,
|
||||
new.date,
|
||||
new.status,
|
||||
new.prix_total,
|
||||
new.trace_paiement);
|
||||
end
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `commandesproduits`
|
||||
--
|
||||
|
||||
CREATE TABLE `commandesproduits` (
|
||||
`id_commande` int(11) NOT NULL,
|
||||
`id_produit` int(11) NOT NULL,
|
||||
`quantite` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Triggers `commandesproduits`
|
||||
--
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `tai_commandesproduit` AFTER INSERT ON `commandesproduits` FOR EACH ROW begin
|
||||
|
||||
declare v_nom varchar(255);
|
||||
declare v_description varchar(1024);
|
||||
declare v_marque varchar(255);
|
||||
declare v_achatmin varchar(255);
|
||||
declare v_economie varchar(255);
|
||||
declare v_unite varchar(255);
|
||||
declare v_format varchar(255);
|
||||
declare v_limite varchar(255);
|
||||
declare v_categorie varchar(255);
|
||||
|
||||
|
||||
select p.nom,
|
||||
p.description,
|
||||
p.marque,
|
||||
p.achat_minimum,
|
||||
p.economie,
|
||||
p.unite,
|
||||
f2.nom,
|
||||
p.limite_achat,
|
||||
c2.nom into v_nom, v_description, v_marque, v_achatmin, v_economie, v_unite, v_format, v_limite, v_categorie
|
||||
from produits p
|
||||
inner join format f2 on p.format = f2.id_format
|
||||
inner join categorie c2 on p.categorie = c2.id_categorie
|
||||
where p.id_produit = new.id_produit;
|
||||
|
||||
insert into historiquecommandeproduit
|
||||
values ((select id_historique from historiquecommande hc where hc.id_commande = new.id_commande),
|
||||
new.id_produit,
|
||||
v_nom,
|
||||
v_description,
|
||||
v_marque,
|
||||
v_achatmin,
|
||||
v_limite,
|
||||
v_economie,
|
||||
v_unite,
|
||||
v_format,
|
||||
v_categorie,
|
||||
new.quantite);
|
||||
|
||||
end
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `commentaires`
|
||||
--
|
||||
|
||||
CREATE TABLE `commentaires` (
|
||||
`id_commentaire` int(11) NOT NULL,
|
||||
`id_compte` int(11) NOT NULL,
|
||||
`date` datetime NOT NULL,
|
||||
`commentaire` varchar(2048) COLLATE utf8_bin NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `comptes`
|
||||
--
|
||||
|
||||
CREATE TABLE `comptes` (
|
||||
`id_compte` int(11) NOT NULL,
|
||||
`courriel` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`password` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`nom` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`prenom` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`telephone` varchar(30) COLLATE utf8_bin DEFAULT NULL,
|
||||
`type` char(1) COLLATE utf8_bin NOT NULL DEFAULT 'U'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Dumping data for table `comptes`
|
||||
--
|
||||
|
||||
INSERT INTO `comptes` (`id_compte`, `courriel`, `password`, `nom`, `prenom`, `telephone`, `type`) VALUES
|
||||
(16, '[email protected]', '$2y$10$.mB/c0ntseE6/FtaFkZ3n.rze9Bt7vEGi7A0sHtZZnCV3BG1yye6K', 'Admin', 'Admin', '8193761721', 'A');
|
||||
|
||||
--
|
||||
-- Triggers `comptes`
|
||||
--
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `tai_comptes` AFTER INSERT ON `comptes` FOR EACH ROW insert into panier values(NEW.id_compte, null, null)
|
||||
$$
|
||||
DELIMITER ;
|
||||
DELIMITER $$
|
||||
CREATE TRIGGER `tbd_comptes` BEFORE DELETE ON `comptes` FOR EACH ROW delete from panier where panier.id_compte = OLD.id_compte
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `configuration`
|
||||
--
|
||||
|
||||
CREATE TABLE `configuration` (
|
||||
`cle` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`valeur` varchar(4096) COLLATE utf8_bin NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `datescommandes`
|
||||
--
|
||||
|
||||
CREATE TABLE `datescommandes` (
|
||||
`date_debut` datetime NOT NULL,
|
||||
`date_fin` datetime NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `datespaiements`
|
||||
--
|
||||
|
||||
CREATE TABLE `datespaiements` (
|
||||
`date_debut` datetime NOT NULL,
|
||||
`date_fin` datetime NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `format`
|
||||
--
|
||||
|
||||
CREATE TABLE `format` (
|
||||
`id_format` int(11) NOT NULL,
|
||||
`nom` varchar(255) COLLATE utf8_bin NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Dumping data for table `format`
|
||||
--
|
||||
|
||||
INSERT INTO `format` (`id_format`, `nom`) VALUES
|
||||
(1, 'kg');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `fournisseurs`
|
||||
--
|
||||
|
||||
CREATE TABLE `fournisseurs` (
|
||||
`id_fournisseur` int(11) NOT NULL,
|
||||
`nom` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`adresse` varchar(1024) COLLATE utf8_bin NOT NULL,
|
||||
`telephone` varchar(30) COLLATE utf8_bin DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Dumping data for table `fournisseurs`
|
||||
--
|
||||
|
||||
INSERT INTO `fournisseurs` (`id_fournisseur`, `nom`, `adresse`, `telephone`) VALUES
|
||||
(2, 'Metro', '123 lol', NULL);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `historiquecommande`
|
||||
--
|
||||
|
||||
CREATE TABLE `historiquecommande` (
|
||||
`id_historique` int(11) NOT NULL,
|
||||
`id_commande` int(11) DEFAULT NULL,
|
||||
`id_compte` int(11) DEFAULT NULL,
|
||||
`c_nom` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`c_prenom` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`c_courriel` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`date` datetime DEFAULT NULL,
|
||||
`status` char(1) COLLATE utf8_bin DEFAULT NULL,
|
||||
`prix_total` decimal(10,2) DEFAULT NULL,
|
||||
`trace_paiement` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `historiquecommandeproduit`
|
||||
--
|
||||
|
||||
CREATE TABLE `historiquecommandeproduit` (
|
||||
`id_historique` int(11) DEFAULT NULL,
|
||||
`id_produit` int(11) DEFAULT NULL,
|
||||
`p_nom` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`p_description` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
|
||||
`p_marque` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`p_commandemin` int(11) DEFAULT NULL,
|
||||
`p_limiteachat` int(11) DEFAULT NULL,
|
||||
`p_economie` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`p_unite` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`p_format` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`p_categorie` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`quantite` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `panier`
|
||||
--
|
||||
|
||||
CREATE TABLE `panier` (
|
||||
`id_compte` int(11) NOT NULL,
|
||||
`id_produit` int(11) DEFAULT NULL,
|
||||
`quantite` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `produits`
|
||||
--
|
||||
|
||||
CREATE TABLE `produits` (
|
||||
`id_produit` int(11) NOT NULL,
|
||||
`nom` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`description` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
|
||||
`marque` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`achat_minimum` int(10) NOT NULL,
|
||||
`economie` varchar(255) COLLATE utf8_bin DEFAULT NULL,
|
||||
`image_produit` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
|
||||
`valeur_nutritive` varchar(1024) COLLATE utf8_bin DEFAULT NULL,
|
||||
`format` int(11) NOT NULL,
|
||||
`unite` varchar(15) COLLATE utf8_bin NOT NULL,
|
||||
`limite_achat` int(11) DEFAULT NULL,
|
||||
`categorie` int(11) NOT NULL,
|
||||
`id_compte` int(11) DEFAULT NULL,
|
||||
`status` char(1) COLLATE utf8_bin NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Dumping data for table `produits`
|
||||
--
|
||||
|
||||
INSERT INTO `produits` (`id_produit`, `nom`, `description`, `marque`, `achat_minimum`, `economie`, `image_produit`, `valeur_nutritive`, `format`, `unite`, `limite_achat`, `categorie`, `id_compte`, `status`) VALUES
|
||||
(6, 'Farine', 'Une bonne farine', 'Francine', 100, '', 'uploads_5bf7168aa89ef2.87995613.jpg', NULL, 1, '1', 69, 1, NULL, 'A'),
|
||||
(7, 'Saucisse', 'Une bonne saucisse', 'La fernandière', 420, '', 'uploads_5bf716ec8045c1.37408180.jpg', NULL, 1, '1', 0, 2, NULL, 'A');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `produitsfournisseurs`
|
||||
--
|
||||
|
||||
CREATE TABLE `produitsfournisseurs` (
|
||||
`id_produit` int(11) NOT NULL,
|
||||
`id_fournisseur` int(11) NOT NULL,
|
||||
`prix` decimal(10,2) NOT NULL,
|
||||
`economie` decimal(4,2) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Dumping data for table `produitsfournisseurs`
|
||||
--
|
||||
|
||||
INSERT INTO `produitsfournisseurs` (`id_produit`, `id_fournisseur`, `prix`, `economie`) VALUES
|
||||
(6, 2, '5.00', NULL),
|
||||
(7, 2, '10.00', NULL);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `tracepaiements`
|
||||
--
|
||||
|
||||
CREATE TABLE `tracepaiements` (
|
||||
`id_paiement` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
||||
--
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Indexes for table `access_token`
|
||||
--
|
||||
ALTER TABLE `access_token`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
--
|
||||
-- Indexes for table `categorie`
|
||||
--
|
||||
ALTER TABLE `categorie`
|
||||
ADD PRIMARY KEY (`id_categorie`);
|
||||
|
||||
--
|
||||
-- Indexes for table `commandes`
|
||||
--
|
||||
ALTER TABLE `commandes`
|
||||
ADD PRIMARY KEY (`id_commande`,`id_compte`),
|
||||
ADD KEY `Commandes_fk0` (`id_compte`),
|
||||
ADD KEY `Commandes_fk1` (`trace_paiement`);
|
||||
|
||||
--
|
||||
-- Indexes for table `commandesproduits`
|
||||
--
|
||||
ALTER TABLE `commandesproduits`
|
||||
ADD PRIMARY KEY (`id_commande`,`id_produit`),
|
||||
ADD KEY `CommandesProduits_fk1` (`id_produit`);
|
||||
|
||||
--
|
||||
-- Indexes for table `commentaires`
|
||||
--
|
||||
ALTER TABLE `commentaires`
|
||||
ADD PRIMARY KEY (`id_commentaire`,`id_compte`),
|
||||
ADD KEY `Commentaires_fk0` (`id_compte`);
|
||||
|
||||
--
|
||||
-- Indexes for table `comptes`
|
||||
--
|
||||
ALTER TABLE `comptes`
|
||||
ADD PRIMARY KEY (`id_compte`),
|
||||
ADD KEY `id_compte` (`id_compte`);
|
||||
|
||||
--
|
||||
-- Indexes for table `configuration`
|
||||
--
|
||||
ALTER TABLE `configuration`
|
||||
ADD PRIMARY KEY (`cle`);
|
||||
|
||||
--
|
||||
-- Indexes for table `datescommandes`
|
||||
--
|
||||
ALTER TABLE `datescommandes`
|
||||
ADD PRIMARY KEY (`date_debut`,`date_fin`);
|
||||
|
||||
--
|
||||
-- Indexes for table `datespaiements`
|
||||
--
|
||||
ALTER TABLE `datespaiements`
|
||||
ADD PRIMARY KEY (`date_debut`,`date_fin`);
|
||||
|
||||
--
|
||||
-- Indexes for table `format`
|
||||
--
|
||||
ALTER TABLE `format`
|
||||
ADD PRIMARY KEY (`id_format`),
|
||||
ADD KEY `id_format` (`id_format`);
|
||||
|
||||
--
|
||||
-- Indexes for table `fournisseurs`
|
||||
--
|
||||
ALTER TABLE `fournisseurs`
|
||||
ADD PRIMARY KEY (`id_fournisseur`);
|
||||
|
||||
--
|
||||
-- Indexes for table `historiquecommande`
|
||||
--
|
||||
ALTER TABLE `historiquecommande`
|
||||
ADD PRIMARY KEY (`id_historique`);
|
||||
|
||||
--
|
||||
-- Indexes for table `historiquecommandeproduit`
|
||||
--
|
||||
ALTER TABLE `historiquecommandeproduit`
|
||||
ADD KEY `historiquecommandeproduit_id_historique_index` (`id_historique`);
|
||||
|
||||
--
|
||||
-- Indexes for table `panier`
|
||||
--
|
||||
ALTER TABLE `panier`
|
||||
ADD PRIMARY KEY (`id_compte`) USING BTREE,
|
||||
ADD KEY `Panier_fk0` (`id_produit`);
|
||||
|
||||
--
|
||||
-- Indexes for table `produits`
|
||||
--
|
||||
ALTER TABLE `produits`
|
||||
ADD PRIMARY KEY (`id_produit`),
|
||||
ADD KEY `Produits_fk0` (`categorie`),
|
||||
ADD KEY `Produits_fk1` (`id_compte`),
|
||||
ADD KEY `format` (`format`);
|
||||
|
||||
--
|
||||
-- Indexes for table `produitsfournisseurs`
|
||||
--
|
||||
ALTER TABLE `produitsfournisseurs`
|
||||
ADD PRIMARY KEY (`id_produit`,`id_fournisseur`),
|
||||
ADD KEY `ProduitsFournisseurs_fk1` (`id_fournisseur`);
|
||||
|
||||
--
|
||||
-- Indexes for table `tracepaiements`
|
||||
--
|
||||
ALTER TABLE `tracepaiements`
|
||||
ADD PRIMARY KEY (`id_paiement`);
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `access_token`
|
||||
--
|
||||
ALTER TABLE `access_token`
|
||||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `categorie`
|
||||
--
|
||||
ALTER TABLE `categorie`
|
||||
MODIFY `id_categorie` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `commandes`
|
||||
--
|
||||
ALTER TABLE `commandes`
|
||||
MODIFY `id_commande` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `commentaires`
|
||||
--
|
||||
ALTER TABLE `commentaires`
|
||||
MODIFY `id_commentaire` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `comptes`
|
||||
--
|
||||
ALTER TABLE `comptes`
|
||||
MODIFY `id_compte` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `format`
|
||||
--
|
||||
ALTER TABLE `format`
|
||||
MODIFY `id_format` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `fournisseurs`
|
||||
--
|
||||
ALTER TABLE `fournisseurs`
|
||||
MODIFY `id_fournisseur` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `historiquecommande`
|
||||
--
|
||||
ALTER TABLE `historiquecommande`
|
||||
MODIFY `id_historique` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `produits`
|
||||
--
|
||||
ALTER TABLE `produits`
|
||||
MODIFY `id_produit` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
|
||||
|
||||
--
|
||||
-- AUTO_INCREMENT for table `tracepaiements`
|
||||
--
|
||||
ALTER TABLE `tracepaiements`
|
||||
MODIFY `id_paiement` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `commandes`
|
||||
--
|
||||
ALTER TABLE `commandes`
|
||||
ADD CONSTRAINT `Commandes_fk0` FOREIGN KEY (`id_compte`) REFERENCES `comptes` (`id_compte`),
|
||||
ADD CONSTRAINT `Commandes_fk1` FOREIGN KEY (`trace_paiement`) REFERENCES `tracepaiements` (`id_paiement`);
|
||||
|
||||
--
|
||||
-- Constraints for table `commandesproduits`
|
||||
--
|
||||
ALTER TABLE `commandesproduits`
|
||||
ADD CONSTRAINT `CommandesProduits_fk0` FOREIGN KEY (`id_commande`) REFERENCES `commandes` (`id_commande`),
|
||||
ADD CONSTRAINT `CommandesProduits_fk1` FOREIGN KEY (`id_produit`) REFERENCES `produits` (`id_produit`);
|
||||
|
||||
--
|
||||
-- Constraints for table `commentaires`
|
||||
--
|
||||
ALTER TABLE `commentaires`
|
||||
ADD CONSTRAINT `Commentaires_fk0` FOREIGN KEY (`id_compte`) REFERENCES `comptes` (`id_compte`);
|
||||
|
||||
--
|
||||
-- Constraints for table `historiquecommandeproduit`
|
||||
--
|
||||
ALTER TABLE `historiquecommandeproduit`
|
||||
ADD CONSTRAINT `historiquecommandeproduit__fk` FOREIGN KEY (`id_historique`) REFERENCES `historiquecommande` (`id_historique`);
|
||||
|
||||
--
|
||||
-- Constraints for table `panier`
|
||||
--
|
||||
ALTER TABLE `panier`
|
||||
ADD CONSTRAINT `Panier_fk0` FOREIGN KEY (`id_produit`) REFERENCES `produits` (`id_produit`),
|
||||
ADD CONSTRAINT `panier_ibfk_1` FOREIGN KEY (`id_compte`) REFERENCES `comptes` (`id_compte`);
|
||||
|
||||
--
|
||||
-- Constraints for table `produits`
|
||||
--
|
||||
ALTER TABLE `produits`
|
||||
ADD CONSTRAINT `Format_fk2` FOREIGN KEY (`format`) REFERENCES `format` (`id_format`),
|
||||
ADD CONSTRAINT `Produits_fk0` FOREIGN KEY (`categorie`) REFERENCES `categorie` (`id_categorie`),
|
||||
ADD CONSTRAINT `Produits_fk1` FOREIGN KEY (`id_compte`) REFERENCES `comptes` (`id_compte`);
|
||||
|
||||
--
|
||||
-- Constraints for table `produitsfournisseurs`
|
||||
--
|
||||
ALTER TABLE `produitsfournisseurs`
|
||||
ADD CONSTRAINT `ProduitsFournisseurs_fk0` FOREIGN KEY (`id_produit`) REFERENCES `produits` (`id_produit`),
|
||||
ADD CONSTRAINT `ProduitsFournisseurs_fk1` FOREIGN KEY (`id_fournisseur`) REFERENCES `fournisseurs` (`id_fournisseur`);
|
||||
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 */;
|
||||
Reference in new issue
Block a user