Remove hasTriggers() and hasIndicies().
authorsoranzo <soranzo>
Fri, 16 Jul 2004 11:38:21 +0000 (11:38 +0000)
committersoranzo <soranzo>
Fri, 16 Jul 2004 11:38:21 +0000 (11:38 +0000)
classes/database/BaseDB.php
classes/database/Postgres.php

index 10f7bce0a380c7d488619861c2bd34656893cd4f..23d342f74e016200729bdbdec1d9b69df8ddd9d2 100644 (file)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: BaseDB.php,v 1.54 2004/07/15 10:06:25 soranzo Exp $
+ * $Id: BaseDB.php,v 1.55 2004/07/16 11:38:21 soranzo Exp $
  */
 
 include_once('./classes/database/ADODB_base.php');
@@ -246,7 +246,6 @@ class BaseDB extends ADODB_base {
        function hasViews() { return false; }
        function hasSequences() { return false; }
        function hasFunctions() { return false; }
-       function hasTriggers() { return false; }
        function hasOperators() { return false; }
        function hasTypes() { return false; }
        function hasAggregates() { return false; }
index 170ff4891d180ec661296557a2dba9f83447b131..dd7391f66b573f3e6a14e5548ef18d4c79b95695 100755 (executable)
@@ -4,7 +4,7 @@
  * A class that implements the DB interface for Postgres
  * Note: This class uses ADODB and returns RecordSets.
  *
- * $Id: Postgres.php,v 1.238 2004/07/15 10:59:55 soranzo Exp $
+ * $Id: Postgres.php,v 1.239 2004/07/16 11:38:21 soranzo Exp $
  */
 
 // @@@ THOUGHT: What about inherits? ie. use of ONLY???
@@ -647,44 +647,40 @@ class Postgres extends BaseDB {
                $sql = '';
 
                // Indexes
-               if ($this->hasIndicies()) {
-                       $indexes = &$this->getIndexes($table);
-                       if (!is_object($indexes)) {
-                               $this->rollbackTransaction();
-                               return null;
-                       }
+               $indexes = &$this->getIndexes($table);
+               if (!is_object($indexes)) {
+                       $this->rollbackTransaction();
+                       return null;
+               }
 
-                       if ($indexes->recordCount() > 0) {
-                               $sql .= "\n-- Indexes\n\n";
-                               while (!$indexes->EOF) {
-                                       $sql .= $indexes->f['idxdef'] . ";\n";
+               if ($indexes->recordCount() > 0) {
+                       $sql .= "\n-- Indexes\n\n";
+                       while (!$indexes->EOF) {
+                               $sql .= $indexes->f['idxdef'] . ";\n";
 
-                                       $indexes->moveNext();
-                               }
+                               $indexes->moveNext();
                        }
                }
 
                // Triggers
-               if ($this->hasTriggers()) {
-                       $triggers = &$this->getTriggers($table);
-                       if (!is_object($triggers)) {
-                               $this->rollbackTransaction();
-                               return null;
-                       }
+               $triggers = &$this->getTriggers($table);
+               if (!is_object($triggers)) {
+                       $this->rollbackTransaction();
+                       return null;
+               }
 
-                       if ($triggers->recordCount() > 0) {
-                               $sql .= "\n-- Triggers\n\n";
-                               while (!$triggers->EOF) {
-                                       // Nasty hack to support pre-7.4 PostgreSQL
-                                       if ($triggers->f['tgdef'] !== null)
-                                               $sql .= $triggers->f['tgdef'];
-                                       else 
-                                               $sql .= $this->getTriggerDef($triggers->f);     
+               if ($triggers->recordCount() > 0) {
+                       $sql .= "\n-- Triggers\n\n";
+                       while (!$triggers->EOF) {
+                               // Nasty hack to support pre-7.4 PostgreSQL
+                               if ($triggers->f['tgdef'] !== null)
+                                       $sql .= $triggers->f['tgdef'];
+                               else 
+                                       $sql .= $this->getTriggerDef($triggers->f);     
 
-                                       $sql .= ";\n";
+                               $sql .= ";\n";
 
-                                       $triggers->moveNext();
-                               }
+                               $triggers->moveNext();
                        }
                }
 
@@ -3890,11 +3886,9 @@ class Postgres extends BaseDB {
        function hasViews() { return true; }
        function hasSequences() { return true; }
        function hasFunctions() { return true; }
-       function hasTriggers() { return true; }
        function hasOperators() { return true; }
        function hasTypes() { return true; }
        function hasAggregates() { return true; }
-       function hasIndicies() { return true; }
        function hasLanguages() { return true; }
        function hasOpClasses() { return true; }