r21499 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21498‎ | r21499 | r21500 >
Date:18:33, 23 April 2007
Author:greg
Status:old
Tags:
Comment:
Remove mysql5 schema stuff, various minor updates.
Modified paths:
  • /trunk/phase3/maintenance/postgres/compare_schemas.pl (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/postgres/compare_schemas.pl
@@ -7,8 +7,8 @@
88 use warnings;
99 use Data::Dumper;
1010
11 -my @old = ("../tables.sql", "../mysql5/tables.sql", "../mysql5/tables-binary.sql");
12 -my $new = "tables.sql";
 11+my @old = ('../tables.sql');
 12+my $new = 'tables.sql';
1313 my @xfile;
1414
1515 ## Read in exceptions and other metadata
@@ -27,7 +27,7 @@
2828 push @xfile, $val;
2929 next;
3030 }
31 - for (split(/\s+/ => $val)) {
 31+ for (split /\s+/ => $val) {
3232 $ok{$name}{$_} = 0;
3333 }
3434 }
@@ -46,7 +46,7 @@
4747
4848 my $typeval2 = qr{ unsigned| binary| NOT NULL| NULL| auto_increment| default ['\-\d\w"]+| REFERENCES .+CASCADE};
4949
50 -my $indextype = join '|' => qw(INDEX KEY FULLTEXT), "PRIMARY KEY", "UNIQUE INDEX", "UNIQUE KEY";
 50+my $indextype = join '|' => qw(INDEX KEY FULLTEXT), 'PRIMARY KEY', 'UNIQUE INDEX', 'UNIQUE KEY';
5151 $indextype = qr{$indextype};
5252
5353 my $engine = qr{TYPE|ENGINE};
@@ -55,7 +55,7 @@
5656
5757 my $charset = qr{utf8|binary};
5858
59 -open my $newfh, "<", $new or die qq{Could not open $new: $!\n};
 59+open my $newfh, '<', $new or die qq{Could not open $new: $!\n};
6060
6161
6262 my ($table,%old);
@@ -83,7 +83,7 @@
8484
8585 my $oldfile = shift;
8686
87 - open my $oldfh, "<", $oldfile or die qq{Could not open $oldfile: $!\n};
 87+ open my $oldfh, '<', $oldfile or die qq{Could not open $oldfile: $!\n};
8888
8989 my %info;
9090 while (<$oldfh>) {
@@ -97,6 +97,10 @@
9898 $table = $1;
9999 $info{$table}{name}=$table;
100100 }
 101+ elsif (m#^\) /\*\$wgDBTableOptions\*/#) {
 102+ $info{$table}{engine} = 'TYPE';
 103+ $info{$table}{type} = 'variable';
 104+ }
101105 elsif (/^\) ($engine)=($tabletype);$/) {
102106 $info{$table}{engine}=$1;
103107 $info{$table}{type}=$2;
@@ -110,8 +114,8 @@
111115 $info{$table}{column}{$1} = $2;
112116 }
113117 elsif (/^ ($indextype)(?: (\w+))? \(([\w, \(\)]+)\),?$/) {
114 - $info{$table}{lc $1."_name"} = $2 ? $2 : "";
115 - $info{$table}{lc $1."pk_target"} = $3;
 118+ $info{$table}{lc $1.'_name'} = $2 ? $2 : '';
 119+ $info{$table}{lc $1.'pk_target'} = $3;
116120 }
117121 else {
118122 die "Cannot parse line $. of $oldfile:\n$_\n";
@@ -235,9 +239,7 @@
236240 __DATA__
237241 ## Known exceptions
238242 OLD: searchindex ## We use tsearch2 directly on the page table instead
239 -OLD: archive ## This is a view due to the char(14) timestamp hack
240243 RENAME: user mwuser ## Reserved word causing lots of problems
241244 RENAME: text pagecontent ## Reserved word
242 -NEW: archive2 ## The real archive table
243245 NEW: mediawiki_version ## Just us, for now
244246 XFILE: ../archives/patch-profiling.sql