-- phpMyAdmin SQL Dump -- version 3.3.10 -- http://www.phpmyadmin.net -- -- Serveur: localhost -- Généré le : Sam 27 Août 2011 à 14:13 -- Version du serveur: 5.1.49 -- Version de PHP: 5.3.3-7+squeeze1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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 utf8 */; -- -- Base de données: `zt` -- -- -------------------------------------------------------- -- -- Structure de la table `cat` -- CREATE TABLE IF NOT EXISTS `cat` ( `idcat` int(10) unsigned NOT NULL AUTO_INCREMENT, `parent` int(10) unsigned DEFAULT NULL, `titre` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`idcat`), KEY `prt` (`parent`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ; -- -------------------------------------------------------- -- -- Structure de la table `ddl` -- CREATE TABLE IF NOT EXISTS `ddl` ( `idddl` int(10) unsigned NOT NULL AUTO_INCREMENT, `cat` int(10) unsigned DEFAULT NULL, `titre` varchar(80) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `url` text COLLATE utf8_unicode_ci NOT NULL, `taille` bigint(20) unsigned DEFAULT NULL, `auteur` int(10) unsigned DEFAULT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`idddl`), KEY `catddl` (`cat`), KEY `mbrddlup` (`auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=90 ; -- -------------------------------------------------------- -- -- Structure de la table `ddl_coms` -- CREATE TABLE IF NOT EXISTS `ddl_coms` ( `idddl_coms` int(10) unsigned NOT NULL AUTO_INCREMENT, `ddlid` int(10) unsigned NOT NULL, `auteur` int(10) unsigned DEFAULT NULL, `contenu` text COLLATE utf8_unicode_ci, `creation` datetime NOT NULL, PRIMARY KEY (`idddl_coms`), KEY `ddlidcom` (`ddlid`), KEY `mbrddlcom` (`auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=203 ; -- -------------------------------------------------------- -- -- Structure de la table `ddl_hits` -- CREATE TABLE IF NOT EXISTS `ddl_hits` ( `mbr` int(10) unsigned NOT NULL, `ddl_id` int(10) unsigned NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`mbr`,`ddl_id`), KEY `mbrddldown` (`mbr`), KEY `ddlidi` (`ddl_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `ddl_votes` -- CREATE TABLE IF NOT EXISTS `ddl_votes` ( `idddl` int(10) unsigned NOT NULL, `mid` int(10) unsigned NOT NULL, `note` tinyint(3) unsigned NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`idddl`,`mid`), KEY `mbrddlvote` (`mid`), KEY `idddlvote` (`idddl`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `dons` -- CREATE TABLE IF NOT EXISTS `dons` ( `iddons` int(10) unsigned NOT NULL AUTO_INCREMENT, `mid` int(10) unsigned NOT NULL, `creation` datetime NOT NULL, `valeur` float unsigned NOT NULL, PRIMARY KEY (`iddons`), KEY `mbrdon` (`mid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `frm_cat` -- CREATE TABLE IF NOT EXISTS `frm_cat` ( `idfrm_cat` int(10) unsigned NOT NULL AUTO_INCREMENT, `frm_catnom` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`idfrm_cat`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Structure de la table `frm_forum` -- CREATE TABLE IF NOT EXISTS `frm_forum` ( `idfrm_forum` int(10) unsigned NOT NULL AUTO_INCREMENT, `catid` int(10) unsigned NOT NULL, `frm_titre` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `frm_desc` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`idfrm_forum`), KEY `cat` (`catid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ; -- -------------------------------------------------------- -- -- Structure de la table `frm_msg` -- CREATE TABLE IF NOT EXISTS `frm_msg` ( `idfrm_msg` int(10) unsigned NOT NULL AUTO_INCREMENT, `sujet` int(10) unsigned NOT NULL, `auteur` int(10) unsigned DEFAULT NULL, `message` mediumtext COLLATE utf8_unicode_ci NOT NULL, `creation` datetime NOT NULL, `edition` datetime DEFAULT NULL, `suppression` datetime DEFAULT NULL, PRIMARY KEY (`idfrm_msg`), KEY `sjt` (`sujet`), KEY `mbr` (`auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3086 ; -- -------------------------------------------------------- -- -- Structure de la table `frm_sujet` -- CREATE TABLE IF NOT EXISTS `frm_sujet` ( `idfrm_sujet` int(10) unsigned NOT NULL AUTO_INCREMENT, `forum` int(10) unsigned NOT NULL, `titre` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `hits` int(10) unsigned NOT NULL, `verrouille` tinyint(1) NOT NULL DEFAULT '0', `postit` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`idfrm_sujet`), KEY `frmsjt` (`forum`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=545 ; -- -------------------------------------------------------- -- -- Structure de la table `frm_sujetopt` -- CREATE TABLE IF NOT EXISTS `frm_sujetopt` ( `idsjt` int(10) unsigned NOT NULL, `mbrid` int(10) unsigned NOT NULL, `favori` tinyint(1) NOT NULL DEFAULT '0', `poste` tinyint(1) NOT NULL DEFAULT '0', `derniermsglu` int(10) unsigned NOT NULL, PRIMARY KEY (`idsjt`,`mbrid`), KEY `mbrsjtopt` (`mbrid`), KEY `sjtidopt` (`idsjt`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `ip` -- CREATE TABLE IF NOT EXISTS `ip` ( `ip` varbinary(16) NOT NULL, `mid` int(10) unsigned NOT NULL, `creation` datetime NOT NULL, `lastconnect` datetime NOT NULL, PRIMARY KEY (`ip`), KEY `mbrip` (`mid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `membre` -- CREATE TABLE IF NOT EXISTS `membre` ( `mbr_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `password` char(32) COLLATE utf8_unicode_ci NOT NULL, `random` varchar(5) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `avatar` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `creation` datetime NOT NULL, `lastvisit` datetime DEFAULT NULL, `pid` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `droits` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`mbr_id`), KEY `mbrpid` (`pid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=100000 ; -- -------------------------------------------------------- -- -- Structure de la table `mp_msg` -- CREATE TABLE IF NOT EXISTS `mp_msg` ( `mpmsg_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `mp_id` int(10) unsigned DEFAULT NULL, `mp_auteur` int(10) unsigned DEFAULT NULL, `mp_date` datetime DEFAULT NULL, `mp_txt` mediumtext COLLATE utf8_unicode_ci, PRIMARY KEY (`mpmsg_id`), KEY `mpsjtmsg` (`mp_id`), KEY `membrempmsg` (`mp_auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=808 ; -- -------------------------------------------------------- -- -- Structure de la table `mp_participants` -- CREATE TABLE IF NOT EXISTS `mp_participants` ( `mp_id` int(10) unsigned NOT NULL, `mp_mid` int(10) unsigned NOT NULL, `readed` tinyint(1) DEFAULT NULL, `deleted` tinyint(1) DEFAULT NULL, PRIMARY KEY (`mp_id`,`mp_mid`), KEY `mpsjtpart` (`mp_id`), KEY `mbrmppart` (`mp_mid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `mp_sujet` -- CREATE TABLE IF NOT EXISTS `mp_sujet` ( `mp_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `mp_sujet` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`mp_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=318 ; -- -------------------------------------------------------- -- -- Structure de la table `news` -- CREATE TABLE IF NOT EXISTS `news` ( `idnews` int(10) unsigned NOT NULL AUTO_INCREMENT, `titre` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `contenu` text COLLATE utf8_unicode_ci NOT NULL, `creation` datetime NOT NULL, `auteur` int(10) unsigned NOT NULL, PRIMARY KEY (`idnews`), KEY `mbrnews` (`auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; -- -------------------------------------------------------- -- -- Structure de la table `requete` -- CREATE TABLE IF NOT EXISTS `requete` ( `idrequete` int(11) NOT NULL AUTO_INCREMENT, `catid` int(10) unsigned NOT NULL, `titre` varchar(140) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `auteur` int(10) unsigned DEFAULT NULL, `uploader` int(10) unsigned DEFAULT NULL, `creation` datetime DEFAULT NULL, `reponse` datetime DEFAULT NULL, PRIMARY KEY (`idrequete`), KEY `reqcat` (`catid`), KEY `reqmbr1` (`uploader`), KEY `reqmbr2` (`auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `sdg_questions` -- CREATE TABLE IF NOT EXISTS `sdg_questions` ( `idsdg_questions` int(10) unsigned NOT NULL AUTO_INCREMENT, `question` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`idsdg_questions`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ; -- -------------------------------------------------------- -- -- Structure de la table `sdg_reponses` -- CREATE TABLE IF NOT EXISTS `sdg_reponses` ( `idsdg_reponses` int(10) unsigned NOT NULL AUTO_INCREMENT, `idquest` int(10) unsigned NOT NULL, `reponse` varchar(128) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`idsdg_reponses`), KEY `idquest` (`idquest`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=32 ; -- -------------------------------------------------------- -- -- Structure de la table `sdg_votes` -- CREATE TABLE IF NOT EXISTS `sdg_votes` ( `idreponse` int(10) unsigned NOT NULL, `mid` int(10) unsigned NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`mid`,`idreponse`), KEY `mbrvote` (`mid`), KEY `idreponsesdg` (`idreponse`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `shoutbox` -- CREATE TABLE IF NOT EXISTS `shoutbox` ( `sht_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `sht_mid` int(10) unsigned DEFAULT NULL, `sht_date` datetime DEFAULT NULL, `sht_txt` text COLLATE utf8_unicode_ci, `sht_system` tinyint(1) DEFAULT '0', `sht_priorite` tinyint(4) DEFAULT NULL, PRIMARY KEY (`sht_id`), KEY `membre` (`sht_mid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=23832 ; -- -------------------------------------------------------- -- -- Structure de la table `sht_coms` -- CREATE TABLE IF NOT EXISTS `sht_coms` ( `idsht_coms` int(11) NOT NULL AUTO_INCREMENT, `shtcom_sid` int(10) unsigned DEFAULT NULL, `shtcom_mid` int(10) unsigned NOT NULL, `shtcom_date` datetime DEFAULT NULL, `shtcom_txt` mediumtext COLLATE utf8_unicode_ci, PRIMARY KEY (`idsht_coms`), KEY `shtcommid` (`shtcom_mid`), KEY `shtcomsht` (`shtcom_sid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3329 ; -- -------------------------------------------------------- -- -- Structure de la table `sht_likes` -- CREATE TABLE IF NOT EXISTS `sht_likes` ( `sht_id` int(10) unsigned NOT NULL, `mbr_id` int(10) unsigned NOT NULL, `warn` char(1) COLLATE utf8_unicode_ci DEFAULT '0', PRIMARY KEY (`sht_id`,`mbr_id`), KEY `shtlikesid` (`sht_id`), KEY `shtlikembr` (`mbr_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `top_referer` -- CREATE TABLE IF NOT EXISTS `top_referer` ( `idtop_referer` int(10) unsigned NOT NULL AUTO_INCREMENT, `idsite` int(10) unsigned NOT NULL, `ip` int(10) unsigned NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`idtop_referer`), KEY `topsitereferer` (`idsite`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `top_sites` -- CREATE TABLE IF NOT EXISTS `top_sites` ( `idsite` int(10) unsigned NOT NULL AUTO_INCREMENT, `nom` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `proprio` int(10) unsigned DEFAULT NULL, `banniere` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `upload` bigint(20) unsigned NOT NULL, PRIMARY KEY (`idsite`), KEY `mbrtopsites` (`proprio`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ; -- -------------------------------------------------------- -- -- Structure de la table `top_votes` -- CREATE TABLE IF NOT EXISTS `top_votes` ( `idtop_votes` int(10) unsigned NOT NULL AUTO_INCREMENT, `idsite` int(10) unsigned NOT NULL, `ip` int(10) unsigned NOT NULL, `mid` int(10) unsigned DEFAULT NULL, `dateclic` datetime NOT NULL, `note` tinyint(3) unsigned DEFAULT NULL, PRIMARY KEY (`idtop_votes`), KEY `votetopsite` (`idsite`), KEY `mid` (`mid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=164 ; -- -------------------------------------------------------- -- -- Structure de la table `torrent` -- CREATE TABLE IF NOT EXISTS `torrent` ( `hash` char(40) COLLATE utf8_unicode_ci NOT NULL, `titre` varchar(80) COLLATE utf8_unicode_ci NOT NULL, `cat` int(10) unsigned NOT NULL, `description` mediumtext COLLATE utf8_unicode_ci NOT NULL, `creation` datetime NOT NULL, `auteur` int(10) unsigned DEFAULT NULL, `taille` bigint(20) unsigned NOT NULL, `couverture` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`hash`), KEY `uploadertor` (`auteur`), KEY `cattor` (`cat`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `torrents_coms` -- CREATE TABLE IF NOT EXISTS `torrents_coms` ( `idtorrents_coms` int(10) unsigned NOT NULL AUTO_INCREMENT, `hash` char(40) COLLATE utf8_unicode_ci NOT NULL, `auteur` int(10) unsigned DEFAULT NULL, `contenu` text COLLATE utf8_unicode_ci NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`idtorrents_coms`), KEY `torcomhash` (`hash`), KEY `torcommid` (`auteur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7315 ; -- -------------------------------------------------------- -- -- Structure de la table `torrents_connectes` -- CREATE TABLE IF NOT EXISTS `torrents_connectes` ( `hash` char(40) COLLATE utf8_unicode_ci NOT NULL, `pid` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `peer_id` char(40) COLLATE utf8_unicode_ci NOT NULL, `mid` int(10) unsigned DEFAULT NULL, `ip` varbinary(16) NOT NULL, `port` smallint(5) unsigned NOT NULL, `download` bigint(20) unsigned NOT NULL, `upload` bigint(20) unsigned NOT NULL, `reste` bigint(20) unsigned NOT NULL, `useragent` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `datemaj` datetime NOT NULL, PRIMARY KEY (`hash`,`pid`), KEY `mbrconmid` (`mid`), KEY `torhashcon` (`hash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `torrents_connectes_offset` -- CREATE TABLE IF NOT EXISTS `torrents_connectes_offset` ( `hash` char(40) COLLATE utf8_unicode_ci NOT NULL, `pid` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `download` bigint(20) unsigned NOT NULL, `upload` bigint(20) unsigned NOT NULL, PRIMARY KEY (`hash`,`pid`), KEY `mbroffset` (`pid`), KEY `hashoffset` (`hash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Structure de la table `torrents_votes` -- CREATE TABLE IF NOT EXISTS `torrents_votes` ( `hash` char(40) COLLATE utf8_unicode_ci NOT NULL, `mid` int(10) unsigned NOT NULL, `note` tinyint(3) unsigned NOT NULL, `creation` datetime NOT NULL, PRIMARY KEY (`hash`,`mid`), KEY `mbrtorvote` (`mid`), KEY `hashtorvote` (`hash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Contraintes pour les tables exportées -- -- -- Contraintes pour la table `cat` -- ALTER TABLE `cat` ADD CONSTRAINT `prt` FOREIGN KEY (`parent`) REFERENCES `cat` (`idcat`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Contraintes pour la table `ddl` -- ALTER TABLE `ddl` ADD CONSTRAINT `catddl` FOREIGN KEY (`cat`) REFERENCES `cat` (`idcat`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `mbrddlup` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Contraintes pour la table `ddl_coms` -- ALTER TABLE `ddl_coms` ADD CONSTRAINT `ddlidcom` FOREIGN KEY (`ddlid`) REFERENCES `ddl` (`idddl`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mbrddlcom` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Contraintes pour la table `ddl_hits` -- ALTER TABLE `ddl_hits` ADD CONSTRAINT `ddlidi` FOREIGN KEY (`ddl_id`) REFERENCES `ddl` (`idddl`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mbrddldown` FOREIGN KEY (`mbr`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `ddl_votes` -- ALTER TABLE `ddl_votes` ADD CONSTRAINT `ddl_votes_ibfk_2` FOREIGN KEY (`idddl`) REFERENCES `ddl` (`idddl`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `ddl_votes_ibfk_1` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `dons` -- ALTER TABLE `dons` ADD CONSTRAINT `mbrdon` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Contraintes pour la table `frm_forum` -- ALTER TABLE `frm_forum` ADD CONSTRAINT `cat` FOREIGN KEY (`catid`) REFERENCES `frm_cat` (`idfrm_cat`) ON DELETE NO ACTION ON UPDATE CASCADE; -- -- Contraintes pour la table `frm_msg` -- ALTER TABLE `frm_msg` ADD CONSTRAINT `mbr` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `sjt` FOREIGN KEY (`sujet`) REFERENCES `frm_sujet` (`idfrm_sujet`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `frm_sujet` -- ALTER TABLE `frm_sujet` ADD CONSTRAINT `frmsjt` FOREIGN KEY (`forum`) REFERENCES `frm_forum` (`idfrm_forum`) ON DELETE NO ACTION ON UPDATE CASCADE; -- -- Contraintes pour la table `frm_sujetopt` -- ALTER TABLE `frm_sujetopt` ADD CONSTRAINT `mbrsjtopt` FOREIGN KEY (`mbrid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `sjtidopt` FOREIGN KEY (`idsjt`) REFERENCES `frm_sujet` (`idfrm_sujet`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `ip` -- ALTER TABLE `ip` ADD CONSTRAINT `mbrip` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `mp_msg` -- ALTER TABLE `mp_msg` ADD CONSTRAINT `membrempmsg` FOREIGN KEY (`mp_auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `mpsjtmsg` FOREIGN KEY (`mp_id`) REFERENCES `mp_sujet` (`mp_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `mp_participants` -- ALTER TABLE `mp_participants` ADD CONSTRAINT `mbrmppart` FOREIGN KEY (`mp_mid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mpsjtpart` FOREIGN KEY (`mp_id`) REFERENCES `mp_sujet` (`mp_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `news` -- ALTER TABLE `news` ADD CONSTRAINT `mbrnews` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON UPDATE CASCADE; -- -- Contraintes pour la table `requete` -- ALTER TABLE `requete` ADD CONSTRAINT `reqcat` FOREIGN KEY (`catid`) REFERENCES `cat` (`idcat`) ON UPDATE CASCADE, ADD CONSTRAINT `reqmbr1` FOREIGN KEY (`uploader`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `reqmbr2` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Contraintes pour la table `sdg_reponses` -- ALTER TABLE `sdg_reponses` ADD CONSTRAINT `idquest` FOREIGN KEY (`idquest`) REFERENCES `sdg_questions` (`idsdg_questions`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `sdg_votes` -- ALTER TABLE `sdg_votes` ADD CONSTRAINT `idreponsesdg` FOREIGN KEY (`idreponse`) REFERENCES `sdg_reponses` (`idsdg_reponses`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mbrvote` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `shoutbox` -- ALTER TABLE `shoutbox` ADD CONSTRAINT `membre` FOREIGN KEY (`sht_mid`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Contraintes pour la table `sht_coms` -- ALTER TABLE `sht_coms` ADD CONSTRAINT `shtcommid` FOREIGN KEY (`shtcom_mid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `shtcomsht` FOREIGN KEY (`shtcom_sid`) REFERENCES `shoutbox` (`sht_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `sht_likes` -- ALTER TABLE `sht_likes` ADD CONSTRAINT `shtlikembr` FOREIGN KEY (`mbr_id`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `shtlikesid` FOREIGN KEY (`sht_id`) REFERENCES `shoutbox` (`sht_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `top_referer` -- ALTER TABLE `top_referer` ADD CONSTRAINT `topsitereferer` FOREIGN KEY (`idsite`) REFERENCES `top_sites` (`idsite`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `top_sites` -- ALTER TABLE `top_sites` ADD CONSTRAINT `mbrtopsites` FOREIGN KEY (`proprio`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Contraintes pour la table `top_votes` -- ALTER TABLE `top_votes` ADD CONSTRAINT `top_votes_ibfk_1` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `votetopsite` FOREIGN KEY (`idsite`) REFERENCES `top_sites` (`idsite`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Contraintes pour la table `torrent` -- ALTER TABLE `torrent` ADD CONSTRAINT `cattor` FOREIGN KEY (`cat`) REFERENCES `cat` (`idcat`) ON DELETE NO ACTION ON UPDATE CASCADE, ADD CONSTRAINT `uploadertor` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Contraintes pour la table `torrents_coms` -- ALTER TABLE `torrents_coms` ADD CONSTRAINT `torcommid` FOREIGN KEY (`auteur`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `torrents_coms_ibfk_1` FOREIGN KEY (`hash`) REFERENCES `torrent` (`hash`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `torrents_connectes` -- ALTER TABLE `torrents_connectes` ADD CONSTRAINT `mbrconmid` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE SET NULL ON UPDATE CASCADE, ADD CONSTRAINT `torrents_connectes_ibfk_1` FOREIGN KEY (`hash`) REFERENCES `torrent` (`hash`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `torrents_connectes_offset` -- ALTER TABLE `torrents_connectes_offset` ADD CONSTRAINT `mbroffset` FOREIGN KEY (`pid`) REFERENCES `membre` (`pid`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `torrents_connectes_offset_ibfk_1` FOREIGN KEY (`hash`) REFERENCES `torrent` (`hash`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Contraintes pour la table `torrents_votes` -- ALTER TABLE `torrents_votes` ADD CONSTRAINT `torrents_votes_ibfk_1` FOREIGN KEY (`hash`) REFERENCES `torrent` (`hash`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `torrents_votes_ibfk_2` FOREIGN KEY (`mid`) REFERENCES `membre` (`mbr_id`) ON DELETE CASCADE ON UPDATE CASCADE; INSERT INTO `cat` (`idcat`, `parent`, `titre`, `image`) VALUES (1, NULL, 'Movies', 'movies.png'), (2, NULL, 'TV series', 'television.png'), (3, NULL, 'Music albums', 'music.png'), (4, NULL, 'Games', 'controller.png'), (5, NULL, 'Softwares', 'application.png'), (6, NULL, 'Books', 'books.png'), (7, NULL, 'Animes', 'kids.png'), (8, NULL, 'Documentaries', 'video.png'); INSERT INTO `membre` (`mbr_id`, `username`, `password`, `random`, `email`, `avatar`, `creation`, `lastvisit`, `pid`, `droits`) VALUES(2, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', '99850', 'admin@email.com', null, NOW(), NOW(), 'de5831162cd732c59efba163abc76507', 'adm');