summaryrefslogtreecommitdiff
path: root/maintenance/postgres
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
committerPierre Schmitz <pierre@archlinux.de>2009-02-22 13:37:51 +0100
commitb9b85843572bf283f48285001e276ba7e61b63f6 (patch)
tree4c6f4571552ada9ccfb4030481dcf77308f8b254 /maintenance/postgres
parentd9a20acc4e789cca747ad360d87ee3f3e7aa58c1 (diff)
updated to MediaWiki 1.14.0
Diffstat (limited to 'maintenance/postgres')
-rw-r--r--maintenance/postgres/archives/patch-ipb_address_unique.sql1
-rw-r--r--maintenance/postgres/compare_schemas.pl3
-rw-r--r--maintenance/postgres/mediawiki_mysql2postgres.pl6
-rw-r--r--maintenance/postgres/tables.sql13
4 files changed, 14 insertions, 9 deletions
diff --git a/maintenance/postgres/archives/patch-ipb_address_unique.sql b/maintenance/postgres/archives/patch-ipb_address_unique.sql
index 9cfc6318..e618f99c 100644
--- a/maintenance/postgres/archives/patch-ipb_address_unique.sql
+++ b/maintenance/postgres/archives/patch-ipb_address_unique.sql
@@ -1,2 +1 @@
-DROP INDEX IF EXISTS ipb_address;
CREATE UNIQUE INDEX ipb_address_unique ON ipblocks (ipb_address,ipb_user,ipb_auto,ipb_anon_only);
diff --git a/maintenance/postgres/compare_schemas.pl b/maintenance/postgres/compare_schemas.pl
index 84415d79..144663df 100644
--- a/maintenance/postgres/compare_schemas.pl
+++ b/maintenance/postgres/compare_schemas.pl
@@ -379,6 +379,7 @@ tl_namespace int SMALLINT
wl_namespace int SMALLINT
## Easy enough to change if a wiki ever does grow this big:
+ss_active_users bigint INTEGER
ss_good_articles bigint INTEGER
ss_total_edits bigint INTEGER
ss_total_pages bigint INTEGER
@@ -479,7 +480,7 @@ sub scan_dir {
my $dir = shift;
opendir my $dh, $dir or die qq{Could not opendir $dir: $!\n};
- print "Scanning $dir...\n";
+ #print "Scanning $dir...\n";
for my $file (grep { -f "$dir/$_" and /\.php$/ } readdir $dh) {
find_problems("$dir/$file");
}
diff --git a/maintenance/postgres/mediawiki_mysql2postgres.pl b/maintenance/postgres/mediawiki_mysql2postgres.pl
index 47fa3c0c..a3b17f94 100644
--- a/maintenance/postgres/mediawiki_mysql2postgres.pl
+++ b/maintenance/postgres/mediawiki_mysql2postgres.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
## Convert data from a MySQL mediawiki database into a Postgres mediawiki database
-## svn: $Id: mediawiki_mysql2postgres.pl 33556 2008-04-18 16:27:57Z greg $
+## svn: $Id: mediawiki_mysql2postgres.pl 43845 2008-11-22 06:44:45Z greg $
## NOTE: It is probably easier to dump your wiki using maintenance/dumpBackup.php
## and then import it with maintenance/importDump.php
@@ -181,7 +181,7 @@ $MYSQLSOCKET and $conninfo .= "\n-- socket $MYSQLSOCKET";
print qq{
-- Dump of MySQL Mediawiki tables for import into a Postgres Mediawiki schema
-- Performed by the program: $0
--- Version: $VERSION (subversion }.q{$LastChangedRevision: 33556 $}.qq{)
+-- Version: $VERSION (subversion }.q{$LastChangedRevision: 43845 $}.qq{)
-- Author: Greg Sabino Mullane <greg\@turnstep.com> Comments welcome
--
-- This file was created: $now
@@ -275,7 +275,7 @@ $verbose and warn qq{Writing truncates to empty existing tables\n};
for my $t (@torder, 'objectcache', 'querycache') {
next if $t eq '---';
my $tname = $special{$t}||$t;
- printf qq{TRUNCATE TABLE %-20s;\n}, qq{"$tname"};
+ printf qq{TRUNCATE TABLE %-20s CASCADE;\n}, qq{"$tname"};
}
print "\n\n";
diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql
index cd8dd8a7..93cee862 100644
--- a/maintenance/postgres/tables.sql
+++ b/maintenance/postgres/tables.sql
@@ -173,6 +173,7 @@ CREATE TABLE templatelinks (
tl_title TEXT NOT NULL
);
CREATE UNIQUE INDEX templatelinks_unique ON templatelinks (tl_namespace,tl_title,tl_from);
+CREATE INDEX templatelinks_from ON templatelinks (tl_from);
CREATE TABLE imagelinks (
il_from INTEGER NOT NULL REFERENCES page(page_id) ON DELETE CASCADE,
@@ -210,9 +211,10 @@ CREATE TABLE site_stats (
ss_row_id INTEGER NOT NULL UNIQUE,
ss_total_views INTEGER DEFAULT 0,
ss_total_edits INTEGER DEFAULT 0,
- ss_good_articles INTEGER DEFAULT 0,
+ ss_good_articles INTEGER DEFAULT 0,
ss_total_pages INTEGER DEFAULT -1,
ss_users INTEGER DEFAULT -1,
+ ss_active_users INTEGER DEFAULT -1,
ss_admins INTEGER DEFAULT -1,
ss_images INTEGER DEFAULT 0
);
@@ -239,7 +241,9 @@ CREATE TABLE ipblocks (
ipb_range_start TEXT,
ipb_range_end TEXT,
ipb_deleted SMALLINT NOT NULL DEFAULT 0,
- ipb_block_email SMALLINT NOT NULL DEFAULT 0
+ ipb_block_email SMALLINT NOT NULL DEFAULT 0,
+ ipb_allow_usertalk SMALLINT NOT NULL DEFAULT 0
+
);
CREATE UNIQUE INDEX ipb_address_unique ON ipblocks (ipb_address,ipb_user,ipb_auto,ipb_anon_only);
CREATE INDEX ipb_user ON ipblocks (ipb_user);
@@ -350,6 +354,7 @@ CREATE TABLE recentchanges (
rc_params TEXT
);
CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp);
+CREATE INDEX rc_timestamp_bot ON recentchanges (rc_timestamp) WHERE rc_bot = 0;
CREATE INDEX rc_namespace_title ON recentchanges (rc_namespace, rc_title);
CREATE INDEX rc_cur_id ON recentchanges (rc_cur_id);
CREATE INDEX new_name_timestamp ON recentchanges (rc_new, rc_namespace, rc_timestamp);
@@ -363,7 +368,7 @@ CREATE TABLE watchlist (
wl_notificationtimestamp TIMESTAMPTZ
);
CREATE UNIQUE INDEX wl_user_namespace_title ON watchlist (wl_namespace, wl_title, wl_user);
-
+CREATE INDEX wl_user ON watchlist (wl_user);
CREATE TABLE math (
math_inputhash BYTEA NOT NULL UNIQUE,
@@ -568,5 +573,5 @@ CREATE TABLE mediawiki_version (
);
INSERT INTO mediawiki_version (type,mw_version,sql_version,sql_date)
- VALUES ('Creation','??','$LastChangedRevision: 40517 $','$LastChangedDate: 2008-09-06 02:14:20 -0500 (Sat, 06 Sep 2008) $');
+ VALUES ('Creation','??','$LastChangedRevision: 41967 $','$LastChangedDate: 2008-10-11 07:08:10 -0500 (Sat, 11 Oct 2008) $');