summaryrefslogtreecommitdiff
path: root/maintenance/postgres/archives
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
commit086ae52d12011746a75f5588e877347bc0457352 (patch)
treee73263c7a29d0f94fafb874562610e16eb292ba8 /maintenance/postgres/archives
parent749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff)
Update auf MediaWiki 1.12.0
Diffstat (limited to 'maintenance/postgres/archives')
-rw-r--r--maintenance/postgres/archives/patch-protected_titles.sql10
-rw-r--r--maintenance/postgres/archives/patch-ts2pagetitle.sql13
2 files changed, 23 insertions, 0 deletions
diff --git a/maintenance/postgres/archives/patch-protected_titles.sql b/maintenance/postgres/archives/patch-protected_titles.sql
new file mode 100644
index 00000000..93f10e44
--- /dev/null
+++ b/maintenance/postgres/archives/patch-protected_titles.sql
@@ -0,0 +1,10 @@
+CREATE TABLE protected_titles (
+ pt_namespace SMALLINT NOT NULL,
+ pt_title TEXT NOT NULL,
+ pt_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL,
+ pt_reason TEXT NULL,
+ pt_timestamp TIMESTAMPTZ NOT NULL,
+ pt_expiry TIMESTAMPTZ NULL,
+ pt_create_perm TEXT NOT NULL DEFAULT ''
+);
+CREATE UNIQUE INDEX protected_titles_unique ON protected_titles(pt_namespace, pt_title);
diff --git a/maintenance/postgres/archives/patch-ts2pagetitle.sql b/maintenance/postgres/archives/patch-ts2pagetitle.sql
new file mode 100644
index 00000000..4ac985e3
--- /dev/null
+++ b/maintenance/postgres/archives/patch-ts2pagetitle.sql
@@ -0,0 +1,13 @@
+CREATE OR REPLACE FUNCTION ts2_page_title()
+RETURNS TRIGGER
+LANGUAGE plpgsql AS
+$mw$
+BEGIN
+IF TG_OP = 'INSERT' THEN
+ NEW.titlevector = to_tsvector('default',REPLACE(NEW.page_title,'/',' '));
+ELSIF NEW.page_title != OLD.page_title THEN
+ NEW.titlevector := to_tsvector('default',REPLACE(NEW.page_title,'/',' '));
+END IF;
+RETURN NEW;
+END;
+$mw$;