summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-09-07 10:42:56 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-09-07 10:42:56 +0000
commit92d9533353e6cc555c6c9bbcfa9579fe04404445 (patch)
tree39c4830f0d24a0394402336cf477259e8f3c01bc
parenta6f970e9d29607ff3b1c8f647c0c0d5a9b15f4bc (diff)
downloadbrdo-92d9533353e6cc555c6c9bbcfa9579fe04404445.tar.gz
brdo-92d9533353e6cc555c6c9bbcfa9579fe04404445.tar.bz2
#173566 by bjaspan: remove db_update_field(), because it can easily be used for evil (and mostly nothing else). We should not let contributed modules to easily break their database.
-rw-r--r--includes/database.mysql-common.inc16
-rw-r--r--includes/database.pgsql.inc36
2 files changed, 0 insertions, 52 deletions
diff --git a/includes/database.mysql-common.inc b/includes/database.mysql-common.inc
index 937a8e16b..f56c32143 100644
--- a/includes/database.mysql-common.inc
+++ b/includes/database.mysql-common.inc
@@ -453,22 +453,6 @@ function db_change_field(&$ret, $table, $field, $field_new, $spec) {
}
/**
- * Update a field definition to match its schema. If the field is
- * involved in any keys or indexes, recreate them.
- *
- * @param $ret
- * Array to which query results will be added.
- * @param $table
- * Name of the table.
- * @param $field
- * Name of the field to update.
- */
-function db_update_field(&$ret, $table, $field) {
- $spec = drupal_get_schema($table);
- db_change_field($ret, $table, $field, $field, $spec['fields'][$field]);
-}
-
-/**
* Returns the last insert id.
*
* @param $table
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index 4e4d9bbe5..5778aac10 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -864,42 +864,6 @@ function db_change_field(&$ret, $table, $field, $field_new, $spec) {
}
/**
- * Update a field definition to match its schema. If the field is
- * involved in any keys or indexes, recreate them if necessary.
- *
- * @param $ret
- * Array to which query results will be added.
- * @param $table
- * Name of the table.
- * @param $field
- * Name of the field to update.
- */
-function db_update_field(&$ret, $table, $field) {
- $spec = drupal_get_schema($table);
-
- db_change_field($ret, $table, $field, $field, $spec['fields'][$field]);
- if (isset($spec['primary key'])) {
- if (array_search($field, db_field_names($spec['primary key'])) !== FALSE) {
- db_add_primary_key($ret, $table, $spec['primary key']);
- }
- }
- if (isset($spec['unique keys'])) {
- foreach ($spec['unique keys'] as $name => $fields) {
- if (array_search($field, db_field_names($fields)) !== FALSE) {
- db_add_unique_key($ret, $table, $fields);
- }
- }
- }
- if (isset($spec['indexes'])) {
- foreach ($spec['indexes'] as $name => $fields) {
- if (array_search($field, db_field_names($fields)) !== FALSE) {
- db_add_index($ret, $table, $fields);
- }
- }
- }
-}
-
-/**
* @} End of "ingroup schemaapi".
*/