]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mysqlschema.php
define Reply::pkeyGet()
[quix0rs-gnu-social.git] / lib / mysqlschema.php
index 153b79ccd9ff058e9c8d037769775908bc3cc523..c3d3501c74cff52f6018cc73ac8120be65970a75 100644 (file)
@@ -244,6 +244,20 @@ class MysqlSchema extends Schema
         return $this->fetchQueryData($sql);
     }
 
+    /**
+     * Append an SQL statement with an index definition for a full-text search
+     * index over one or more columns on a table.
+     *
+     * @param array $statements
+     * @param string $table
+     * @param string $name
+     * @param array $def
+     */
+    function appendCreateFulltextIndex(array &$statements, $table, $name, array $def)
+    {
+        $statements[] = "CREATE FULLTEXT INDEX $name ON $table " . $this->buildIndexList($def);
+    }
+
     /**
      * Close out a 'create table' SQL statement.
      *
@@ -387,7 +401,14 @@ class MysqlSchema extends Schema
             $vals = array_map(array($this, 'quote'), $column['enum']);
             return 'enum(' . implode(',', $vals) . ')';
         } else if ($this->_isString($column)) {
-            return parent::typeAndSize($column) . ' CHARSET utf8';
+            $col = parent::typeAndSize($column);
+            if (!empty($column['charset'])) {
+                $col .= ' CHARSET ' . $column['charset'];
+            }
+            if (!empty($column['collate'])) {
+                $col .= ' COLLATE ' . $column['collate'];
+            }
+            return $col;
         } else {
             return parent::typeAndSize($column);
         }