]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14957 get_columns() improvements
authorskodak <skodak>
Sun, 25 May 2008 23:17:21 +0000 (23:17 +0000)
committerskodak <skodak>
Sun, 25 May 2008 23:17:21 +0000 (23:17 +0000)
lib/dml/database_column_info.php

index dec719550965e2370f8bea967f7b09e059a16bad..452dad03ca7a609d7244243d512ce521aed20cad 100644 (file)
@@ -80,7 +80,7 @@ class database_column_info {
     public $default_value;
 
     /**
-     * True if field values unique
+     * True if field values unique, false if not
      */
     public $unique;
 
@@ -108,5 +108,17 @@ class database_column_info {
                 $this->$key = $value;
             }
         }
+
+        switch ($this->meta_type) {
+            case 'R': // normalise counters (usually 'id')
+                $this->auto_increment = true;
+                $this->binary         = false;
+                $this->has_default    = false;
+                $this->default_value  = null;
+                $this->unique         = true;
+            case 'C':
+                $this->auto_increment = false;
+                $this->binary         = false;
+        }
     }
 }