   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`

  `id` int(11) NOT NULL AUTO_INCREMENT,
  `word` varchar(400) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

--
-- Contenu de la table `tags`

  `description` text CHARACTER SET utf8 COLLATE utf8_bin,
  `date_created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;

--
-- Contenu de la table `categories`
