From c7ca4e445c7dc6c775e27597cd7b0968fa5fd904 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 4 Mar 2013 01:04:36 +0100 Subject: [PATCH] [feature/avatars] Add migrations data file for avatars The module_auth of the ucp avatar settings are used for checking if the migration has already been installed. PHPBB3-10018 --- .../db/migration/data/310/avatars.php | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 phpBB/includes/db/migration/data/310/avatars.php diff --git a/phpBB/includes/db/migration/data/310/avatars.php b/phpBB/includes/db/migration/data/310/avatars.php new file mode 100644 index 0000000000..de11a64556 --- /dev/null +++ b/phpBB/includes/db/migration/data/310/avatars.php @@ -0,0 +1,64 @@ +db->sql_query($sql); + $module_auth = $this->db->sql_fetchfield('module_auth'); + $this->db->sql_freeresult($result); + return ($module_auth == 'cfg_allow_avatar'); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_avatar_type' => array('VCHAR:255', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_avatar_type' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_avatar_type' => array('TINT:2', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_avatar_type' => array('TINT:2', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('allow_avatar_gravatar', 0)), + ); + } +}