Index: trunk/extensions/CentralNotice/patches/patch-notice_languages.sql |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | -- Update to allow for any number of languages per notice. |
3 | 3 | |
4 | 4 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_notice_languages ( |
5 | | - `id` int unsigned NOT NULL auto_increment PRIMARY KEY, |
| 5 | + `id` int unsigned NOT NULL PRIMARY KEY auto_increment, |
6 | 6 | `not_id` int unsigned NOT NULL, |
7 | 7 | `not_language` varchar(32) NOT NULL |
8 | 8 | ) /*$wgDBTableOptions*/; |
Index: trunk/extensions/CentralNotice/patches/patch-notice_preferred.sql |
— | — | @@ -1,6 +1,6 @@ |
2 | | -# Support for one notice to supercede all others. This allows one notice to |
3 | | -# cancel out all the templates that a non preffered notice might have if they |
4 | | -# overlap. Use case is to be able to use one all language and projects notice |
5 | | -# and have it superceded by a specific one for en wikipedia. |
| 2 | +-- Support for one notice to supercede all others. This allows one notice to |
| 3 | +-- cancel out all the templates that a non preffered notice might have if they |
| 4 | +-- overlap. Use case is to be able to use one all language and projects notice |
| 5 | +-- and have it superceded by a specific one for en wikipedia. |
6 | 6 | |
7 | 7 | ALTER TABLE cn_notices ADD COLUMN not_preferred bool NOT NULL default '0'; |
Index: trunk/extensions/CentralNotice/CentralNotice.sql |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_notices ( |
3 | | - `not_id` int NOT NULL auto_increment, |
| 3 | + `not_id` int NOT NULL PRIMARY KEY auto_increment, |
4 | 4 | `not_name` varchar(255) NOT NULL, |
5 | 5 | `not_start` char(14) NOT NULL, |
6 | 6 | `not_end` char(14) NOT NULL, |
— | — | @@ -7,28 +7,25 @@ |
8 | 8 | `not_preferred` bool NOT NULL default '0', |
9 | 9 | `not_locked` bool NOT NULL default '0', |
10 | 10 | `not_language` varchar(32) NOT NULL, |
11 | | - `not_project` varchar(255) NOT NULL, |
12 | | - PRIMARY KEY (`not_id`) |
| 11 | + `not_project` varchar(255) NOT NULL |
13 | 12 | ) /*$wgDBTableOptions*/; |
14 | 13 | |
15 | 14 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_assignments ( |
16 | | - `asn_id` int NOT NULL auto_increment, |
| 15 | + `asn_id` int NOT NULL PRIMARY KEY auto_increment, |
17 | 16 | `not_id` int NOT NULL, |
18 | 17 | `tmp_id` int NOT NULL, |
19 | | - `tmp_weight` int NOT NULL, |
20 | | - PRIMARY KEY (`asn_id`) |
| 18 | + `tmp_weight` int NOT NULL |
21 | 19 | ) /*$wgDBTableOptions*/; |
22 | 20 | |
23 | 21 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_templates ( |
24 | | - `tmp_id` int NOT NULL auto_increment, |
25 | | - `tmp_name` varchar(255) default NULL, |
26 | | - PRIMARY KEY (`tmp_id`) |
| 22 | + `tmp_id` int NOT NULL PRIMARY KEY auto_increment, |
| 23 | + `tmp_name` varchar(255) default NULL |
27 | 24 | ) /*$wgDBTableOptions*/; |
28 | 25 | |
29 | 26 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/cn_notice_languages ( |
30 | | - `id` int unsigned NOT NULL auto_increment, |
| 27 | + `id` int unsigned NOT NULL PRIMARY KEY auto_increment, |
31 | 28 | `not_id` int unsigned NOT NULL, |
32 | | - `not_language` varchar(32) NOT NULL, |
33 | | - PRIMARY KEY (`id`), |
34 | | - UNIQUE KEY `not_id_not_language` (`not_id`,`not_language`) |
35 | | -) /*$wgDBTableOptions*/; |
\ No newline at end of file |
| 29 | + `not_language` varchar(32) NOT NULL |
| 30 | +) /*$wgDBTableOptions*/; |
| 31 | + |
| 32 | +CREATE UNIQUE KEY `not_id_not_language` ON /*_*/cn_notice_languages(`not_id`,`not_language`) |