protected function checkRcCurIdNullable() { $fi = $this->db->fieldInfo('recentchanges', 'rc_cur_id'); if (!$fi->isNullable()) { $this->output("Removing NOT NULL constraint from 'recentchanges.rc_cur_id'\n"); $this->applyPatch('patch-rc_cur_id-not-null.sql'); } else { $this->output("...column 'recentchanges.rc_cur_id' has a NOT NULL constraint\n"); } }
protected function checkOiDeleted() { if ($this->db->fieldInfo('oldimage', 'oi_deleted')->type() !== 'smallint') { $this->output("Changing 'oldimage.oi_deleted' to type 'smallint'\n"); $this->db->query("ALTER TABLE oldimage ALTER oi_deleted DROP DEFAULT"); $this->db->query("ALTER TABLE oldimage ALTER oi_deleted TYPE SMALLINT USING (oi_deleted::smallint)"); $this->db->query("ALTER TABLE oldimage ALTER oi_deleted SET DEFAULT 0"); } else { $this->output("...column 'oldimage.oi_deleted' is already of type 'smallint'\n"); } }
function fieldInfo($table, $field) { switch ($table) { case 'interwiki': $table = 'plugin_mediawiki_interwiki'; break; default: return DatabasePostgres::fieldInfo($table, $field); } global $wgDBmwschema; $save_wgDBmwschema = $wgDBmwschema; $wgDBmwschema = 'public'; $v = DatabasePostgres::fieldInfo($table, $field); $wgDBmwschema = $save_wgDBmwschema; return $v; }