summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-05-29 11:36:33 +0000
committerDries Buytaert <dries@buytaert.net>2007-05-29 11:36:33 +0000
commitaf34a17925adaec3167d716d601701d80366d3ad (patch)
tree0f8a71e3f3f6978003352ad7f828e0894099ee07
parent556ef56c52bbc9b4f73d69fd79b5b8df7dc26437 (diff)
downloadbrdo-af34a17925adaec3167d716d601701d80366d3ad.tar.gz
brdo-af34a17925adaec3167d716d601701d80366d3ad.tar.bz2
- Patch #147285 by drewish: add db_rename_table().
-rw-r--r--includes/database.mysql-common.inc14
-rw-r--r--includes/database.pgsql.inc14
2 files changed, 28 insertions, 0 deletions
diff --git a/includes/database.mysql-common.inc b/includes/database.mysql-common.inc
index f47d2a8d5..d3fc793bd 100644
--- a/includes/database.mysql-common.inc
+++ b/includes/database.mysql-common.inc
@@ -185,6 +185,20 @@ function db_type_map() {
}
/**
+ * Rename a table.
+ *
+ * @param $ret
+ * Array to which query results will be added.
+ * @param $table
+ * The table to be renamed.
+ * @param $new_name
+ * The new name for the table.
+ */
+function db_rename_table(&$ret, $table, $new_name) {
+ $ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}');
+}
+
+/**
* Drop a table.
*
* @param $ret
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index 3e050d8d1..0602b3500 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -613,6 +613,20 @@ function _db_create_field_sql($name, $spec) {
}
/**
+ * Rename a table.
+ *
+ * @param $ret
+ * Array to which query results will be added.
+ * @param $table
+ * The table to be renamed.
+ * @param $new_name
+ * The new name for the table.
+ */
+function db_rename_table(&$ret, $table, $new_name) {
+ $ret[] = update_sql('ALTER TABLE {'. $table .'} RENAME TO {'. $new_name .'}');
+}
+
+/**
* Drop a table.
*
* @param $ret