r80280 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80279‎ | r80280 | r80281 >
Date:16:50, 14 January 2011
Author:catrope
Status:ok (Comments)
Tags:license-work 
Comment:
Followup r80277: remove PRIMARY KEY and AUTO_INCREMENT from fp_id, doesn't belong there. Also add explanatory comments for the new tables from r80277
Modified paths:
  • /branches/license-work/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: branches/license-work/phase3/maintenance/tables.sql
@@ -1437,19 +1437,31 @@
14381438 ) /*$wgDBTableOptions*/;
14391439 CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin);
14401440
 1441+-- Table listing licenses used for files on the wiki
14411442 CREATE TABLE /*_*/license (
14421443 lic_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 1444+ -- Internal license name. Display name is stored in i18n message
14431445 lic_name varbinary(255) NOT NULL,
 1446+ -- URL to the legally valid license text. Localized or more understandable versions are stored in an i18n message
14441447 lic_url varbinary(255) NOT NULL,
 1448+ -- Counter counting the number of files with this license
14451449 lic_count int signed NOT NULL DEFAULT 0
14461450 ) /*$wgDBTableOptions*/;
14471451 CREATE INDEX /*i*/lic_name ON /*_*/license (lic_name);
14481452 CREATE INDEX /*i*/lic_count ON /*_*/license (lic_count);
14491453
 1454+-- Table for tracking file properties
 1455+-- Each file property (fp_id) can have multiple rows in this table,
 1456+-- allowing for multiple properties and multiple values for each property.
 1457+-- Properties can have a numerical value, a text value, or both.
14501458 CREATE TABLE /*_*/file_props (
1451 - fp_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 1459+ -- File property ID. This is the same for each row referring to the same file revision
 1460+ fp_id int unsigned NOT NULL,
 1461+ -- Property key
14521462 fp_key varbinary(255) NOT NULL,
 1463+ -- Numerical property value, if present
14531464 fp_value_int int signed,
 1465+ -- Textual property value, if present
14541466 fp_value_text varbinary(255)
14551467 ) /*$wgDBTableOptions*/;
14561468 CREATE INDEX /*i*/fp_id_key ON /*_*/file_props (fp_id, fp_key);

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80277license-work: Initial schema changes in tables.sqlcatrope16:16, 14 January 2011

Comments

#Comment by Nikerabbit (talk | contribs)   19:56, 14 January 2011

So this is limited to files?

#Comment by Catrope (talk | contribs)   12:27, 15 January 2011

Yes, only files have licensing info in this design.

#Comment by Bryan (talk | contribs)   10:35, 17 January 2011

However, as props are linked to a revision, it could be easily adapted towards all pages.

#Comment by Krinkle (talk | contribs)   00:17, 16 January 2011

The concept can be seen here: Files and licenses concept as written by me originally.

During the hackthon details and implementation methods were discussed so the actual implementation will be documented here: License integration MediaWiki

Status & tagging log