Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 39
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 1
release_3_0_7_rc1
0.00% covered (danger)
0.00%
0 / 39
0.00% covered (danger)
0.00%
0 / 6
42
0.00% covered (danger)
0.00%
0 / 1
 effectively_installed
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 depends_on
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 update_schema
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 1
2
 revert_schema
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 1
2
 update_data
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
2
 delete_text_templates
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
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
14namespace phpbb\db\migration\data\v30x;
15
16class release_3_0_7_rc1 extends \phpbb\db\migration\migration
17{
18    public function effectively_installed()
19    {
20        return phpbb_version_compare($this->config['version'], '3.0.7-RC1', '>=');
21    }
22
23    public static function depends_on()
24    {
25        return array('\phpbb\db\migration\data\v30x\release_3_0_6');
26    }
27
28    public function update_schema()
29    {
30        return array(
31            'drop_keys' => array(
32                $this->table_prefix . 'log' => array(
33                    'log_time',
34                ),
35            ),
36            'add_index' => array(
37                $this->table_prefix . 'topics_track' => array(
38                    'topic_id' => array('topic_id'),
39                ),
40            ),
41        );
42    }
43
44    public function revert_schema()
45    {
46        return array(
47            'add_index' => array(
48                $this->table_prefix . 'log' => array(
49                    'log_time'    => array('log_time'),
50                ),
51            ),
52            'drop_keys' => array(
53                $this->table_prefix . 'topics_track' => array(
54                    'topic_id',
55                ),
56            ),
57        );
58    }
59
60    public function update_data()
61    {
62        return array(
63            array('config.add', array('feed_overall', 1)),
64            array('config.add', array('feed_http_auth', 0)),
65            array('config.add', array('feed_limit_post', $this->config['feed_limit'])),
66            array('config.add', array('feed_limit_topic', $this->config['feed_overall_topics_limit'])),
67            array('config.add', array('feed_topics_new', $this->config['feed_overall_topics'])),
68            array('config.add', array('feed_topics_active', $this->config['feed_overall_topics'])),
69            array('custom', array(array(&$this, 'delete_text_templates'))),
70
71            array('config.update', array('version', '3.0.7-RC1')),
72        );
73    }
74
75    public function delete_text_templates()
76    {
77        // Delete all text-templates from the template_data
78        $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
79            WHERE template_filename ' . $this->db->sql_like_expression($this->db->get_any_char() . '.txt');
80        $this->sql_query($sql);
81    }
82}