r87626 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87625‎ | r87626 | r87627 >
Date:12:57, 7 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some work on db schema
Modified paths:
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php (modified) (history)
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.sql
@@ -4,15 +4,26 @@
55
66 -- Watch groups
77 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/swl_groups (
8 - group_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY,
9 - group_categories BLOB NOT NULL, -- No need to have this stuff relational, so keep it simple
10 - group_namespaces BLOB NOT NULL, -- No need to have this stuff relational, so keep it simple
11 - group_properties BLOB NOT NULL, -- No need to have this stuff relational, so keep it simple
 8+ group_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY,
 9+ group_categories BLOB NOT NULL, -- No need to have this stuff relational, so keep it simple
 10+ group_namespaces BLOB NOT NULL, -- No need to have this stuff relational, so keep it simple
 11+ group_properties BLOB NOT NULL -- No need to have this stuff relational, so keep it simple
1212 ) /*$wgDBTableOptions*/;
1313
 14+-- List of all changes made to properties.
 15+CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/swl_changes (
 16+ change_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY,
 17+ change_user_id INT(10) unsigned NOT NULL,
 18+ change_page_id INT(10) unsigned NOT NULL,
 19+ change_property VARCHAR(255) NOT NULL,
 20+ change_old_value BLOB NULL,
 21+ change_new_value BLOB NULL,
 22+ change_type INT(1) unsigned NOT NULL
 23+) /*$wgDBTableOptions*/;
 24+
1425 -- Watchlists
15 -CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/swl_watchlists (
16 - list _id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY,
17 - list_user_id INT(10) unsigned NOT NULL UNIQUE, -- TODO
18 - -- TODO
 26+CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/swl_changes_per_group (
 27+ cpg_group_id INT(10) unsigned NOT NULL,
 28+ cpg_change_id INT(10) unsigned NOT NULL,
 29+ PRIMARY KEY (cpg_group_id,cpg_change_id)
1930 ) /*$wgDBTableOptions*/;
\ No newline at end of file
Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php
@@ -150,6 +150,18 @@
151151 dirname( __FILE__ ) . '/SemanticWatchlist.sql',
152152 true
153153 ) );
 154+ $updater->addExtensionUpdate( array(
 155+ 'addTable',
 156+ 'swl_changes',
 157+ dirname( __FILE__ ) . '/SemanticWatchlist.sql',
 158+ true
 159+ ) );
 160+ $updater->addExtensionUpdate( array(
 161+ 'addTable',
 162+ 'swl_changes_per_group',
 163+ dirname( __FILE__ ) . '/SemanticWatchlist.sql',
 164+ true
 165+ ) );
154166 }
155167
156168 return true;

Status & tagging log