r105079 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105078‎ | r105079 | r105080 >
Date:20:50, 3 December 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
importing EducationProgram extension
Modified paths:
  • /trunk/extensions/EducationProgram (added) (history)
  • /trunk/extensions/EducationProgram/sql (added) (history)
  • /trunk/extensions/EducationProgram/sql/EducationProgram.sql (added) (history)

Diff [purge]

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

Comments

#Comment by Jeroen De Dauw (talk | contribs)   20:52, 3 December 2011

Just some initial draft I'm committing so I can get at it easily from my laptop, by no means is this supposed to work or be complete.

#Comment by SVG (talk | contribs)   20:33, 4 December 2011

/*_*/ should be /*$wgDBprefix*/ for database prefix support

#Comment by Jeroen De Dauw (talk | contribs)   23:08, 4 December 2011

Says who? This is what I did in the contest extension and then Roan complained it should be liked this.

#Comment by SVG (talk | contribs)   16:22, 6 December 2011

Database prefixes are supported by /*_*/ ? How can it be?

#Comment by Reedy (talk | contribs)   16:23, 6 December 2011

Look at phase3 tables.sql?

#Comment by SVG (talk | contribs)   16:09, 9 December 2011

Ah, okay. Thanks.

#Comment by Jeroen De Dauw (talk | contribs)   23:09, 4 December 2011

And this works, so marking this as new again.

Status & tagging log