From 0e5f0e043b6fee9d808a7306537a53987cfd9e5b Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 22 Mar 2010 18:14:25 +0000 Subject: [PATCH] Support looking up deferred constraint information. --- includes/db/DatabasePostgres.php | 45 +++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index e76e70ad38..381ebd5f66 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -6,24 +6,27 @@ * */ class PostgresField { - private $name, $tablename, $type, $nullable, $max_length; + private $name, $tablename, $type, $nullable, $max_length, $deferred, $deferrable, $conname; static function fromText($db, $table, $field) { global $wgDBmwschema; $q = <<name = $field; $n->tablename = $table; $n->max_length = $row->attlen; + $n->deferrable = ($row->deferrable == 't'); + $n->deferred = ($row->deferred == 't'); + $n->conname = $row->conname; return $n; } @@ -63,6 +69,19 @@ SQL; function maxLength() { return $this->max_length; } + + function is_deferrable() { + return $this->deferrable; + } + + function is_deferred() { + return $this->deferred; + } + + function conname() { + return $this->conname; + } + } /** -- 2.20.1