[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/db/migration/data/v310/ -> soft_delete_mod_convert2.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\db\migration\data\v310;
  15  
  16  /**
  17   * Migration to convert the Soft Delete MOD for 3.0
  18   *
  19   * https://www.phpbb.com/customise/db/mod/soft_delete/
  20   */
  21  class soft_delete_mod_convert2 extends \phpbb\db\migration\migration
  22  {
  23  	static public function depends_on()
  24      {
  25          return array(
  26              '\phpbb\db\migration\data\v310\soft_delete_mod_convert',
  27          );
  28      }
  29  
  30  	public function effectively_installed()
  31      {
  32          return !$this->db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_deleted');
  33      }
  34  
  35  	public function update_schema()
  36      {
  37          return array(
  38              'drop_columns'        => array(
  39                  $this->table_prefix . 'forums'            => array('forum_deleted_topic_count', 'forum_deleted_reply_count'),
  40                  $this->table_prefix . 'posts'            => array('post_deleted', 'post_deleted_time'),
  41                  $this->table_prefix . 'topics'            => array('topic_deleted', 'topic_deleted_time', 'topic_deleted_reply_count'),
  42              ),
  43          );
  44      }
  45  
  46  	public function revert_schema()
  47      {
  48          return array(
  49              'add_columns'        => array(
  50                  $this->table_prefix . 'forums'            => array(
  51                      'forum_deleted_topic_count'        => array('UINT', 0),
  52                      'forum_deleted_reply_count'        => array('UINT', 0),
  53                  ),
  54                  $this->table_prefix . 'posts'            => array(
  55                      'post_deleted'                    => array('UINT', 0),
  56                      'post_deleted_time'                => array('TIMESTAMP', 0),
  57                  ),
  58                  $this->table_prefix . 'topics'            => array(
  59                      'topic_deleted'                    => array('UINT', 0),
  60                      'topic_deleted_time'            => array('TIMESTAMP', 0),
  61                      'topic_deleted_reply_count'        => array('UINT', 0),
  62                  ),
  63              ),
  64          );
  65      }
  66  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1