summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-21 22:37:15 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-21 22:37:15 +0100
commit1a9a4dc55112d264a61e1c50cf52733c993e0e52 (patch)
treecce9623d55d0057445d6f7d0f4bd6c021969847b /user_guide_src/source
parentba8bf563095657b8b6104ecc3d3a990f3e6ceb75 (diff)
parent27f798b9d64025fecaaecbd80a8cba41d455940f (diff)
Merge branch 'feature/dbforge_table_attributes' into develop
Diffstat (limited to 'user_guide_src/source')
-rw-r--r--user_guide_src/source/changelog.rst3
-rw-r--r--user_guide_src/source/database/forge.rst9
2 files changed, 11 insertions, 1 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 5c01d64af..ae2900761 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -243,8 +243,9 @@ Release Date: Not Released
- Added an optional second parameter to ``drop_table()`` that allows adding the **IF EXISTS** condition, which is no longer the default.
- Added support for passing a custom database object to the loader.
- - Deprecated ``add_column()``'s third method. *AFTER* clause should now be added to the field definition array instead.
+ - Added support for passing custom table attributes (such as ``ENGINE`` for MySQL) to ``create_table()``.
- Added support for usage of the *FIRST* clause in ``add_column()`` for MySQL and CUBRID.
+ - Deprecated ``add_column()``'s third method. *AFTER* clause should now be added to the field definition array instead.
- Overall improved support for all of the drivers.
- :doc:`Database Utility <database/utilities>` changes include:
diff --git a/user_guide_src/source/database/forge.rst b/user_guide_src/source/database/forge.rst
index ca904ed00..48642ad7e 100644
--- a/user_guide_src/source/database/forge.rst
+++ b/user_guide_src/source/database/forge.rst
@@ -201,6 +201,15 @@ into the definition
$this->dbforge->create_table('table_name', TRUE);
// gives CREATE TABLE IF NOT EXISTS table_name
+You could also pass optional table attributes, such as MySQL's ``ENGINE``::
+
+ $attributes = array('ENGINE' => 'InnoDB');
+ $this->dbforge->create_table('table_name', FALSE, $attributes);
+ // produces: CREATE TABLE `table_name` (...) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
+
+.. note:: Unless you specify the ``CHARACTER SET`` and/or ``COLLATE`` attributes,
+ ``create_table()`` will always add them with your configured *char_set*
+ and *dbcollat* values, as long as they are not empty (MySQL only).
Dropping a table
================