1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
-- phpMyAdmin SQL Dump
-- version 3.1.1
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Sam 21 Février 2009 à 19:04
-- Version du serveur: 5.1.30
-- Version de PHP: 5.2.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Base de données: `courses_platform`
--
-- --------------------------------------------------------
--
-- Structure de la table `archives_courses`
--
CREATE TABLE IF NOT EXISTS `archives_courses` (
`ac_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ac_title` varchar(80) NOT NULL,
`ac_description` varchar(255) NOT NULL,
`ac_editor_id` int(10) unsigned NOT NULL,
`ac_edit_date` datetime NOT NULL,
`ac_edit_comment` varchar(255) NOT NULL,
`ac_small_edit` tinyint(1) DEFAULT NULL,
`ac_course_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`ac_id`),
KEY `ac_editor_id` (`ac_editor_id`,`ac_course_id`),
KEY `ac_course_id` (`ac_course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `archives_lessons`
--
CREATE TABLE IF NOT EXISTS `archives_lessons` (
`al_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`al_title` varchar(80) NOT NULL,
`al_description` varchar(255) NOT NULL,
`al_content` text NOT NULL,
`al_editor_id` int(10) unsigned NOT NULL,
`al_edit_date` datetime NOT NULL,
`al_edit_comment` varchar(255) NOT NULL,
`al_small_edit` tinyint(1) DEFAULT NULL,
`al_lesson_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`al_id`),
KEY `al_editor_id` (`al_editor_id`,`al_lesson_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `courses`
--
CREATE TABLE IF NOT EXISTS `courses` (
`c_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`c_title_raw` varchar(80) NOT NULL,
`c_title_formatted` varchar(80) NOT NULL,
`c_description` varchar(255) NOT NULL,
`c_creator_id` int(11) unsigned NOT NULL,
`c_creation_date` datetime NOT NULL,
`c_editor_id` int(11) unsigned DEFAULT NULL,
`c_edit_date` datetime DEFAULT NULL,
`c_edit_comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`c_id`),
UNIQUE KEY `c_title_raw` (`c_title_raw`,`c_title_formatted`,`c_description`),
UNIQUE KEY `c_title_formatted` (`c_title_formatted`),
KEY `c_creator_id` (`c_creator_id`),
KEY `c_editor_id` (`c_editor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `lessons`
--
CREATE TABLE IF NOT EXISTS `lessons` (
`l_id` int(10) unsigned NOT NULL,
`l_title_raw` varchar(80) NOT NULL,
`l_title_formatted` varchar(80) NOT NULL,
`l_description` varchar(255) NOT NULL,
`l_content` text NOT NULL,
`l_course_id` int(10) unsigned NOT NULL,
`l_creator_id` int(10) unsigned NOT NULL,
`l_creation_date` datetime NOT NULL,
`l_editor_id` int(10) unsigned DEFAULT NULL,
`l_edit_date` datetime DEFAULT NULL,
`l_edit_comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`l_id`),
UNIQUE KEY `l_title_raw` (`l_title_raw`,`l_title_formatted`,`l_description`),
KEY `l_course_id` (`l_course_id`,`l_creator_id`,`l_editor_id`),
KEY `l_creator_id` (`l_creator_id`,`l_editor_id`),
KEY `l_editor_id` (`l_editor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`u_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`u_email` varchar(50) NOT NULL,
`u_email_checked` tinyint(1) DEFAULT NULL,
`u_password` varchar(255) DEFAULT NULL,
`u_new_password` varchar(255) DEFAULT NULL,
`u_new_password_expires` date DEFAULT NULL,
`u_token` char(32) DEFAULT NULL,
`u_token_expires` date DEFAULT NULL,
PRIMARY KEY (`u_id`),
UNIQUE KEY `u_email` (`u_email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `archives_courses`
--
ALTER TABLE `archives_courses`
ADD CONSTRAINT `archives_courses_ibfk_1` FOREIGN KEY (`ac_editor_id`) REFERENCES `users` (`u_id`) ON DELETE NO ACTION ON UPDATE CASCADE,
ADD CONSTRAINT `archives_courses_ibfk_2` FOREIGN KEY (`ac_course_id`) REFERENCES `courses` (`c_id`) ON DELETE NO ACTION ON UPDATE CASCADE;
--
-- Contraintes pour la table `courses`
--
ALTER TABLE `courses`
ADD CONSTRAINT `courses_ibfk_6` FOREIGN KEY (`c_editor_id`) REFERENCES `users` (`u_id`) ON DELETE NO ACTION ON UPDATE CASCADE,
ADD CONSTRAINT `courses_ibfk_5` FOREIGN KEY (`c_creator_id`) REFERENCES `users` (`u_id`) ON DELETE NO ACTION ON UPDATE CASCADE;
--
-- Contraintes pour la table `lessons`
--
ALTER TABLE `lessons`
ADD CONSTRAINT `lessons_ibfk_1` FOREIGN KEY (`l_course_id`) REFERENCES `courses` (`c_id`) ON DELETE NO ACTION ON UPDATE CASCADE,
ADD CONSTRAINT `lessons_ibfk_2` FOREIGN KEY (`l_creator_id`) REFERENCES `users` (`u_id`) ON DELETE NO ACTION ON UPDATE CASCADE,
ADD CONSTRAINT `lessons_ibfk_3` FOREIGN KEY (`l_editor_id`) REFERENCES `users` (`u_id`) ON DELETE NO ACTION ON UPDATE CASCADE; |
Partager