Index: trunk/phase3/maintenance/postgres/compare_schemas.pl |
— | — | @@ -7,8 +7,8 @@ |
8 | 8 | use warnings; |
9 | 9 | use Data::Dumper; |
10 | 10 | |
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'; |
13 | 13 | my @xfile; |
14 | 14 | |
15 | 15 | ## Read in exceptions and other metadata |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | push @xfile, $val; |
29 | 29 | next; |
30 | 30 | } |
31 | | - for (split(/\s+/ => $val)) { |
| 31 | + for (split /\s+/ => $val) { |
32 | 32 | $ok{$name}{$_} = 0; |
33 | 33 | } |
34 | 34 | } |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | |
48 | 48 | my $typeval2 = qr{ unsigned| binary| NOT NULL| NULL| auto_increment| default ['\-\d\w"]+| REFERENCES .+CASCADE}; |
49 | 49 | |
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'; |
51 | 51 | $indextype = qr{$indextype}; |
52 | 52 | |
53 | 53 | my $engine = qr{TYPE|ENGINE}; |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | my $charset = qr{utf8|binary}; |
58 | 58 | |
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}; |
60 | 60 | |
61 | 61 | |
62 | 62 | my ($table,%old); |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | |
85 | 85 | my $oldfile = shift; |
86 | 86 | |
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}; |
88 | 88 | |
89 | 89 | my %info; |
90 | 90 | while (<$oldfh>) { |
— | — | @@ -97,6 +97,10 @@ |
98 | 98 | $table = $1; |
99 | 99 | $info{$table}{name}=$table; |
100 | 100 | } |
| 101 | + elsif (m#^\) /\*\$wgDBTableOptions\*/#) { |
| 102 | + $info{$table}{engine} = 'TYPE'; |
| 103 | + $info{$table}{type} = 'variable'; |
| 104 | + } |
101 | 105 | elsif (/^\) ($engine)=($tabletype);$/) { |
102 | 106 | $info{$table}{engine}=$1; |
103 | 107 | $info{$table}{type}=$2; |
— | — | @@ -110,8 +114,8 @@ |
111 | 115 | $info{$table}{column}{$1} = $2; |
112 | 116 | } |
113 | 117 | 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; |
116 | 120 | } |
117 | 121 | else { |
118 | 122 | die "Cannot parse line $. of $oldfile:\n$_\n"; |
— | — | @@ -235,9 +239,7 @@ |
236 | 240 | __DATA__ |
237 | 241 | ## Known exceptions |
238 | 242 | 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 |
240 | 243 | RENAME: user mwuser ## Reserved word causing lots of problems |
241 | 244 | RENAME: text pagecontent ## Reserved word |
242 | | -NEW: archive2 ## The real archive table |
243 | 245 | NEW: mediawiki_version ## Just us, for now |
244 | 246 | XFILE: ../archives/patch-profiling.sql |