diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-02-06 11:19:31 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-02-06 11:32:13 +0100 |
commit | 26640bad3d959fd763feeae7647423b4495cf969 (patch) | |
tree | ce334a92afe241e12629f1401ec00dbe85964271 /phpBB/phpbb | |
parent | 190301021bc85ea4226c1347e1a1209c95997e6f (diff) | |
download | forums-26640bad3d959fd763feeae7647423b4495cf969.tar forums-26640bad3d959fd763feeae7647423b4495cf969.tar.gz forums-26640bad3d959fd763feeae7647423b4495cf969.tar.bz2 forums-26640bad3d959fd763feeae7647423b4495cf969.tar.xz forums-26640bad3d959fd763feeae7647423b4495cf969.zip |
[ticket/12115] Add migration file to remove old user columns
PHPBB3-12115
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php new file mode 100644 index 0000000000..9e7ba68327 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_cleanup.php @@ -0,0 +1,51 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class profilefield_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_occ') && + !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_interests'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_interests', + '\phpbb\db\migration\data\v310\profilefield_occupation', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_occ', + 'user_interests', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_occ' => array('MTEXT', ''), + 'user_interests' => array('MTEXT', ''), + ), + ), + ); + } +} |