summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Podner <a.podner@me.com>2012-12-20 13:56:19 +0100
committerAndrew Podner <a.podner@me.com>2012-12-20 13:56:19 +0100
commit4851217a1330580ebf73f0a6fb79ad451b73759a (patch)
tree59a78374f0812df149abdaa40d2216e1359a3141
parent79494dde1c53b671f279e5c5fab2ae03a9ff0353 (diff)
fixes #2081 : change parameter/variable name to 'foreign_key_checks', update change log
Signed-off-by:Andrew Podner <a.podner@me.com>
-rw-r--r--system/database/DB_utility.php16
-rw-r--r--system/database/drivers/mysql/mysql_utility.php8
-rw-r--r--system/database/drivers/mysqli/mysqli_utility.php8
-rw-r--r--user_guide_src/source/changelog.rst3
-rw-r--r--user_guide_src/source/database/utilities.rst28
5 files changed, 32 insertions, 31 deletions
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index 3ed75967e..aff3cf8c2 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -320,14 +320,14 @@ abstract class CI_DB_utility {
// Set up our default preferences
$prefs = array(
- 'tables' => array(),
- 'ignore' => array(),
- 'filename' => '',
- 'format' => 'gzip', // gzip, zip, txt
- 'add_drop' => TRUE,
- 'add_insert' => TRUE,
- 'newline' => "\n",
- 'fk_checks' => TRUE
+ 'tables' => array(),
+ 'ignore' => array(),
+ 'filename' => '',
+ 'format' => 'gzip', // gzip, zip, txt
+ 'add_drop' => TRUE,
+ 'add_insert' => TRUE,
+ 'newline' => "\n",
+ 'foreign_key_checks' => TRUE
);
// Did the user submit any preferences? If so set them....
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index e2de82d0b..f118033dc 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -77,8 +77,8 @@ class CI_DB_mysql_utility extends CI_DB_utility {
// Build the output
$output = '';
- // Do we need to include a statement to disable FK checks?
- if ($fk_checks === FALSE)
+ // Do we need to include a statement to disable foreign key checks?
+ if ($foreign_key_checks === FALSE)
{
$output .= "SET foreign_key_checks = 0;".$newline;
}
@@ -188,8 +188,8 @@ class CI_DB_mysql_utility extends CI_DB_utility {
$output .= $newline.$newline;
}
- // Do we need to include a statement to re-enable FK checks?
- if ($fk_checks === FALSE)
+ // Do we need to include a statement to re-enable foreign key checks?
+ if ($foreign_key_checks === FALSE)
{
$output .= "SET foreign_key_checks = 1;".$newline;
}
diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php
index ff4949046..2edf38cf5 100644
--- a/system/database/drivers/mysqli/mysqli_utility.php
+++ b/system/database/drivers/mysqli/mysqli_utility.php
@@ -77,8 +77,8 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
// Build the output
$output = '';
- // Do we need to include a statement to disable FK checks?
- if ($fk_checks === FALSE)
+ // Do we need to include a statement to disable foreign key checks?
+ if ($foreign_key_checks === FALSE)
{
$output .= "SET foreign_key_checks = 0;".$newline;
}
@@ -188,8 +188,8 @@ class CI_DB_mysqli_utility extends CI_DB_utility {
$output .= $newline.$newline;
}
- // Do we need to include a statement to re-enable FK checks?
- if ($fk_checks === FALSE)
+ // Do we need to include a statement to re-enable foreign key checks?
+ if ($foreign_key_checks === FALSE)
{
$output .= "SET foreign_key_checks = 1;".$newline;
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index a3d29056e..f3c3bfa50 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -121,6 +121,7 @@ Release Date: Not Released
- Added support for SQLite3 database driver.
- Added Interbase/Firebird database support via the *ibase* driver.
- Added ODBC support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`.
+ - Added 'foreign_key_checks' parameter to MySQL/MySQLi backup, allowing statement to disable/re-enable foreign key checks to be inserted into the backup output
- :doc:`Query Builder <database/query_builder>` changes include:
- Renamed the Active Record class to Query Builder to remove confusion with the Active Record design pattern.
- Added the ability to insert objects with ``insert_batch()``.
@@ -180,7 +181,7 @@ Release Date: Not Released
- Deprecated ``add_column()``'s third method. *AFTER* clause should now be added to the field definition array instead.
- Added support for usage of the *FIRST* clause in ``add_column()`` for MySQL and CUBRID.
- Overall improved support for all of the drivers.
- - :doc:`Database Utility <database/utilities>` chages include:
+ - :doc:`Database Utility <database/utilities>` changes include:
- Added support for passing a custom database object to the loader.
- Modified the class to no longer extend :doc:`Database Forge <database/forge>`, which has been a deprecated behavior for awhile.
- Overall improved support for all of the drivers.
diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst
index 1631066fe..bd40cdadd 100644
--- a/user_guide_src/source/database/utilities.rst
+++ b/user_guide_src/source/database/utilities.rst
@@ -221,17 +221,17 @@ parameter of the ``backup()`` method. Example::
Description of Backup Preferences
---------------------------------
-=============== ======================= ======================= ========================================================================
-Preference Default Value Options Description
-=============== ======================= ======================= ========================================================================
-**tables** empty array None An array of tables you want backed up. If left blank all tables will be
- exported.
-**ignore** empty array None An array of tables you want the backup routine to ignore.
-**format** gzip gzip, zip, txt The file format of the export file.
-**filename** the current date/time None The name of the backed-up file. The name is needed only if you are using
- zip compression.
-**add_drop** TRUE TRUE/FALSE Whether to include DROP TABLE statements in your SQL export file.
-**add_insert** TRUE TRUE/FALSE Whether to include INSERT statements in your SQL export file.
-**newline** "\\n" "\\n", "\\r", "\\r\\n" Type of newline to use in your SQL export file.
-**fk_checks** TRUE TRUE/FALSE Whether output should keep foreign key checks enabled.
-=============== ======================= ======================= ======================================================================== \ No newline at end of file
+======================= ======================= ======================= ========================================================================
+Preference Default Value Options Description
+======================= ======================= ======================= ========================================================================
+**tables** empty array None An array of tables you want backed up. If left blank all tables will be
+ exported.
+**ignore** empty array None An array of tables you want the backup routine to ignore.
+**format** gzip gzip, zip, txt The file format of the export file.
+**filename** the current date/time None The name of the backed-up file. The name is needed only if you are using
+ zip compression.
+**add_drop** TRUE TRUE/FALSE Whether to include DROP TABLE statements in your SQL export file.
+**add_insert** TRUE TRUE/FALSE Whether to include INSERT statements in your SQL export file.
+**newline** "\\n" "\\n", "\\r", "\\r\\n" Type of newline to use in your SQL export file.
+**foreign_key_checks** TRUE TRUE/FALSE Whether output should keep foreign key checks enabled.
+======================= ======================= ======================= ======================================================================== \ No newline at end of file