   ADD CONSTRAINT `directors_movies_ibfk_2` FOREIGN KEY (`movies_id`) REFERENCES `movies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
 
 --
--- Contraintes pour la table `medias`
---
-ALTER TABLE `medias`
-  ADD CONSTRAINT `medias_ibfk_1` FOREIGN KEY (`movies_id`) REFERENCES `movies` (`id`);
+-- Contraintes pour la table `medias_movies`
+--
+ALTER TABLE `medias_movies`
+  ADD CONSTRAINT `medias_movies_ibfk_1` FOREIGN KEY (`movies_id`) REFERENCES `movies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  ADD CONSTRAINT `medias_movies_ibfk_2` FOREIGN KEY (`medias_id`) REFERENCES `medias` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
 
 --
 -- Contraintes pour la table `movies`
 --
 ALTER TABLE `movies`
   ADD CONSTRAINT `movies_ibfk_1` FOREIGN KEY (`categories_id`) REFERENCES `categories` (`id`);
-
---
--- Contraintes pour la table `movies_medias`
---
-ALTER TABLE `movies_medias`
-  ADD CONSTRAINT `movies_medias_ibfk_1` FOREIGN KEY (`movies_id`) REFERENCES `movies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
-  ADD CONSTRAINT `movies_medias_ibfk_2` FOREIGN KEY (`medias_id`) REFERENCES `medias` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
 
 --
 -- Contraintes pour la table `related_movies`

-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Lun 07 Avril 2014 à 05:50
-- Version du serveur: 5.5.35-0ubuntu0.13.10.2
-- Version de PHP: 5.5.3-1ubuntu2.2


(8, 'Tolkien'),
(9, 'Fondcombe'),
(10, 'la Comté'),
(11, 'Orques'),
(12, 'hobbit');

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

