--
-- Table structure for main table
--

CREATE TABLE `{TABLE_NAME}` (
  `id_film` int(5) NOT NULL default '0',
  `titre` varchar(100) NOT NULL default '',
  `sous_titre` varchar(100) default NULL,
  `annee` varchar(4) default NULL,
  `resume` text,
  `duree` int(4) default NULL,
  `cd` int(1) NOT NULL default '1',
  PRIMARY KEY  (`id_film`),
  KEY `titre` (`titre`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `mainacteurs`
--

CREATE TABLE `{TABLE_NAME}acteurs` (
  `id_film` int(5) NOT NULL default '0',
  `id_acteur` int(5) NOT NULL default '0',
  PRIMARY KEY  (`id_film`,`id_acteur`),
  KEY `id_acteur_constraint` (`id_acteur`),
  CONSTRAINT `{TABLE_NAME}_id_acteur_constraint` FOREIGN KEY (`id_acteur`) REFERENCES `{ISRESTRICT}acteurs` (`id_acteur`) ON UPDATE CASCADE,
  CONSTRAINT `{TABLE_NAME}_id_film_constraint` FOREIGN KEY (`id_film`) REFERENCES `{TABLE_NAME}` (`id_film`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Table structure for table `maingenres`
--

CREATE TABLE `{TABLE_NAME}genres` (
  `id_film` int(5) NOT NULL default '0',
  `id_genre` int(5) NOT NULL default '1',
  PRIMARY KEY  (`id_film`,`id_genre`),
  KEY `types_constraint` (`id_genre`),
  CONSTRAINT `{TABLE_NAME}_film_types_constraint` FOREIGN KEY (`id_film`) REFERENCES `{TABLE_NAME}` (`id_film`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `{TABLE_NAME}_types_constraint` FOREIGN KEY (`id_genre`) REFERENCES `{ISRESTRICT}genres` (`id_genre`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `mainorigines`
--

CREATE TABLE `{TABLE_NAME}origines` (
  `id_film` int(5) NOT NULL default '0',
  `id_origine` int(5) NOT NULL default '1',
  PRIMARY KEY  (`id_film`,`id_origine`),
  KEY `origines_constraint` (`id_origine`),
  CONSTRAINT `{TABLE_NAME}_film_origins_constraint` FOREIGN KEY (`id_film`) REFERENCES `{TABLE_NAME}` (`id_film`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `{TABLE_NAME}_origins_constraint` FOREIGN KEY (`id_origine`) REFERENCES `origines` (`id_origine`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `mainrealisateurs`
--

CREATE TABLE `{TABLE_NAME}realisateurs` (
  `id_film` int(5) NOT NULL default '0',
  `id_realisateur` int(5) NOT NULL default '1',
  PRIMARY KEY  (`id_film`,`id_realisateur`),
  KEY `realisateurs_constraint` (`id_realisateur`),
  CONSTRAINT `{TABLE_NAME}_directors_constraint` FOREIGN KEY (`id_realisateur`) REFERENCES `{ISRESTRICT}realisateurs` (`id_realisateur`) ON UPDATE CASCADE,
  CONSTRAINT `{TABLE_NAME}_film_directors_constraint` FOREIGN KEY (`id_film`) REFERENCES `{TABLE_NAME}` (`id_film`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;