addCreateTableSql() is now more encapsulated
[mailer.git] / inc / extensions-functions.php
index ddc4afbb83003e7770d83a6d5b832693759dc35e..acd902dd788a096aca1f2cfdc8e4696518934133 100644 (file)
@@ -1756,11 +1756,16 @@ function isExtensionFunctionFileReadable ($ext_name) {
 }
 
 // Adds a CREATE TABLE statement if the requested table is not there
-function addCreateTableSql ($tableName, $sql) {
+function addCreateTableSql ($tableName, $sql, $comment) {
        // Is the table not there?
        if (!isSqlTableCreated($tableName)) {
                // Is not found, so add it
-               addExtensionSql('CREATE TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ' . $sql);
+               addExtensionSql('CREATE TABLE
+       `{?_MYSQL_PREFIX?}_' . $tableName . '` (' . $sql . ')
+ENGINE = {?_TABLE_TYPE?}
+CHARACTER SET utf8
+COLLATE utf8_general_ci
+COMMENT ' . "'" . $comment . "'");
        } else {
                // Is already there, which should not happen
                debug_report_bug(__FUNCTION__, __LINE__, 'The table ' . $tableName . ' is already created which should not happen.');