diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-03-06 13:52:11 +0100 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-03-06 13:53:24 +0100 |
| commit | 9bddf73d315de89fc65b74bcc81aca8dfe57a796 (patch) | |
| tree | cc361444ae5349c06c7d342363ec23664e090f56 /phpBB/includes/db/migration/data/310/softdelete_p2.php | |
| parent | f5482e73fddc1a00f2c9df5f6428da70e2777547 (diff) | |
| download | forums-9bddf73d315de89fc65b74bcc81aca8dfe57a796.tar forums-9bddf73d315de89fc65b74bcc81aca8dfe57a796.tar.gz forums-9bddf73d315de89fc65b74bcc81aca8dfe57a796.tar.bz2 forums-9bddf73d315de89fc65b74bcc81aca8dfe57a796.tar.xz forums-9bddf73d315de89fc65b74bcc81aca8dfe57a796.zip | |
[ticket/9657] Add migration files for updating the database
PHPBB3-9657
Diffstat (limited to 'phpBB/includes/db/migration/data/310/softdelete_p2.php')
| -rw-r--r-- | phpBB/includes/db/migration/data/310/softdelete_p2.php | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/phpBB/includes/db/migration/data/310/softdelete_p2.php b/phpBB/includes/db/migration/data/310/softdelete_p2.php new file mode 100644 index 0000000000..15de8e7185 --- /dev/null +++ b/phpBB/includes/db/migration/data/310/softdelete_p2.php @@ -0,0 +1,74 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +class phpbb_db_migration_data_310_softdelete_p2 extends phpbb_db_migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_approved'); + } + + static public function depends_on() + { + return array( + 'phpbb_db_migration_data_310_dev', + 'phpbb_db_migration_data_310_softdelete_p1', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array('forum_posts', 'forum_topics', 'forum_topics_real'), + $this->table_prefix . 'posts' => array('post_approved'), + $this->table_prefix . 'topics' => array('topic_approved', 'topic_replies', 'topic_replies_real'), + ), + 'drop_keys' => array( + $this->table_prefix . 'posts' => array('post_approved'), + $this->table_prefix . 'topics' => array('forum_appr_last'), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_posts' => array('UINT', 0), + 'forum_topics' => array('UINT', 0), + 'forum_topics_real' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_approved' => array('BOOL', 1), + ), + $this->table_prefix . 'topics' => array( + 'topic_approved' => array('BOOL', 1), + 'topic_replies' => array('UINT', 0), + 'topic_replies_real' => array('UINT', 0), + ), + ), + 'add_index' => array( + $this->table_prefix . 'posts' => array( + 'post_approved' => array('post_approved'), + ), + $this->table_prefix . 'topics' => array( + 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'), + ), + ), + ); + } + + public function update_data() + { + return array( + ); + } +} |
