diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-29 16:26:45 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-29 16:26:45 -0700 |
commit | f5019ac5aac229b9ac118a905703c675688e4ed0 (patch) | |
tree | a02af7acf3fdbc9f34b661bf0737a16e672c85dc | |
parent | 283d56bed338ca2a6852a1ae50cf8d5ded4c9fef (diff) |
tweaks for the installer whee
-rw-r--r-- | db/core.php | 1 | ||||
-rw-r--r-- | lib/installer.php | 13 | ||||
-rw-r--r-- | lib/mysqlschema.php | 9 |
3 files changed, 15 insertions, 8 deletions
diff --git a/db/core.php b/db/core.php index 695a3e3aa..29aa917c1 100644 --- a/db/core.php +++ b/db/core.php @@ -230,6 +230,7 @@ $schema['notice_source'] = array( 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'name of the source'), 'url' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'url to link to'), 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'date this record was created'), + 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'), ), 'primary key' => array('code'), diff --git a/lib/installer.php b/lib/installer.php index 441f72660..ad1989f4e 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -341,6 +341,7 @@ abstract class Installer } $schema->ensureTable($name, $def); } + return true; } /** @@ -441,11 +442,12 @@ abstract class Installer if (!mb_strlen($stmt)) { continue; } - $res = $conn->execute($stmt); - if (DB::isError($res)) { - $error = $result->getMessage(); + try { + $res = $conn->simpleQuery($stmt); + } catch (Exception $e) { + $error = $e->getMessage(); $this->updateStatus("ERROR ($error) for SQL '$stmt'"); - return $res; + return false; } } return true; @@ -458,9 +460,6 @@ abstract class Installer */ function registerInitialUser() { - define('STATUSNET', true); - define('LACONICA', true); // compatibility - require_once INSTALLDIR . '/lib/common.php'; $data = array('nickname' => $this->adminNick, diff --git a/lib/mysqlschema.php b/lib/mysqlschema.php index 153b79ccd..a2581e6d8 100644 --- a/lib/mysqlschema.php +++ b/lib/mysqlschema.php @@ -387,7 +387,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); } |