(Bug 11363). Change image and filearchive to bytea from text, to match oldimage.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Sun, 23 Sep 2007 20:47:17 +0000 (20:47 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Sun, 23 Sep 2007 20:47:17 +0000 (20:47 +0000)
RELEASE-NOTES
maintenance/postgres/tables.sql
maintenance/updaters.inc

index a99a64c..9ac68ab 100644 (file)
@@ -62,6 +62,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11355) Fix false positives in Safe Mode and other config detection
   when boolean settings are disabled with 'Off' via php_admin_value/php_value
 * (bug 11292) Fixed unserialize errors with Postgres by creating special Blob object.
+* (bug 11363) Make all metadata fields bytea when using Postgres.
 
 === API changes in 1.12 ===
 
index 694c253..3ef6d14 100644 (file)
@@ -243,7 +243,7 @@ CREATE TABLE image (
   img_size         INTEGER   NOT NULL,
   img_width        INTEGER   NOT NULL,
   img_height       INTEGER   NOT NULL,
-  img_metadata     TEXT,
+  img_metadata     BYTEA     NOT NULL  DEFAULT '',
   img_bits         SMALLINT,
   img_media_type   TEXT,
   img_major_mime   TEXT                DEFAULT 'unknown',
@@ -293,7 +293,7 @@ CREATE TABLE filearchive (
   fa_size               SMALLINT     NOT NULL,
   fa_width              SMALLINT     NOT NULL,
   fa_height             SMALLINT     NOT NULL,
-  fa_metadata           TEXT,
+  fa_metadata           BYTEA        NOT NULL  DEFAULT '',
   fa_bits               SMALLINT,
   fa_media_type         TEXT,
   fa_major_mime         TEXT                   DEFAULT 'unknown',
index beadacf..eee546d 100644 (file)
@@ -1351,6 +1351,8 @@ function do_postgres_updates() {
 
        # table, column, desired type, USING clause if needed
        $typechanges = array(
+               array("filearchive",  "fa_metadata",     "bytea", "decode(fa_metadata,'escape')"),
+               array("image",        "img_metadata",    "bytea", "decode(img_metadata,'escape')"),
                array("image",        "img_size",        "int4",  ""),
                array("image",        "img_width",       "int4",  ""),
                array("image",        "img_height",      "int4",  ""),