From ff9e842730ccf251cf8b76401e4df1b1c6edcea2 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 18 Feb 2009 15:19:57 +0000 Subject: #330983 by recidive and boombatower: Rename users/users_roles tables to user/user_role for consistency. --- update.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'update.php') diff --git a/update.php b/update.php index 215727314..32b98ec98 100644 --- a/update.php +++ b/update.php @@ -588,6 +588,8 @@ function update_prepare_d7_bootstrap() { // Allow the database system to work even though the registry has not // been created yet. drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE); + update_prepare_d7_bootstrap_rename(); + include_once DRUPAL_ROOT . '/includes/install.inc'; drupal_install_init_database(); spl_autoload_unregister('drupal_autoload_class'); @@ -606,6 +608,23 @@ function update_prepare_d7_bootstrap() { } } +/** + * Rename tables: + * - {users} to {user} + * - {users_roles} to {user_role} + * - {sessions} to {session} + */ +function update_prepare_d7_bootstrap_rename() { + $ret = array(); + + if (db_table_exists('users')) { + db_rename_table($ret, 'users', 'user'); + db_rename_table($ret, 'users_roles', 'user_role'); + } + + return $ret; +} + /** * Add the update task list to the current page. */ -- cgit v1.2.3