Index: trunk/extensions/EducationProgram/sql/EducationProgram.sql |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +-- MySQL version of the database schema for the WEP extension. |
| 3 | +-- Licence: GNU GPL v3+ |
| 4 | +-- Author: Jeroen De Dauw < jeroendedauw@gmail.com > |
| 5 | + |
| 6 | +-- Organizations, ie universities |
| 7 | +CREATE TABLE IF NOT EXISTS /*_*/wep_orgs ( |
| 8 | + org_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
| 9 | + org_name VARCHAR(255) NOT NULL, |
| 10 | + org_city VARCHAR(255) NOT NULL, |
| 11 | + org_country VARCHAR(255) NOT NULL, |
| 12 | +) /*$wgDBTableOptions*/; |
| 13 | + |
| 14 | +CREATE UNIQUE INDEX /*i*/wep_org_name ON /*_*/wep_orgs (org_name); |
| 15 | + |
| 16 | +-- Courses (still need to figure if these are term instances or not) |
| 17 | +CREATE TABLE IF NOT EXISTS /*_*/wep_courses ( |
| 18 | + course_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
| 19 | + course_org_id INT unsigned NOT NULL, |
| 20 | + course_name VARCHAR(255) NOT NULL, |
| 21 | + course_year SMALLINT unsigned NOT NULL, |
| 22 | + course_start varbinary(14) NOT NULL, |
| 23 | + course_end varbinary(14) NOT NULL, |
| 24 | +) /*$wgDBTableOptions*/; |
| 25 | + |
| 26 | +CREATE INDEX /*i*/wep_course_org_id ON /*_*/wep_courses (course_org_id); |
| 27 | +CREATE INDEX /*i*/wep_course_name ON /*_*/wep_courses (course_name); |
| 28 | +CREATE INDEX /*i*/wep_course_year ON /*_*/wep_courses (course_year); |
| 29 | + |
| 30 | +-- Students |
| 31 | +CREATE TABLE IF NOT EXISTS /*_*/wep_students ( |
| 32 | + student_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
| 33 | + student_user_id INT unsigned NOT NULL, |
| 34 | +) /*$wgDBTableOptions*/; |
| 35 | + |
| 36 | +CREATE INDEX /*i*/wep_students_user_id ON /*_*/wep_students (student_user_id); |
| 37 | + |
| 38 | +-- Students |
| 39 | +CREATE TABLE IF NOT EXISTS /*_*/wep_mentors ( |
| 40 | + mentor_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
| 41 | + mentor_user_id INT unsigned NOT NULL, |
| 42 | +) /*$wgDBTableOptions*/; |
| 43 | + |
| 44 | +CREATE INDEX /*i*/wep_mentors_user_id ON /*_*/wep_students (mentor_user_id); |
\ No newline at end of file |