1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* |
4
|
|
|
* Advertisement management. An extension for the phpBB Forum Software package. |
5
|
|
|
* |
6
|
|
|
* @copyright (c) 2017 phpBB Limited <https://www.phpbb.com> |
7
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0) |
8
|
|
|
* |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace phpbb\ads\migrations\v10x; |
12
|
|
|
|
13
|
|
|
class m9_views_clicks extends \phpbb\db\migration\migration |
|
|
|
|
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* {@inheritDoc} |
17
|
|
|
*/ |
18
|
|
|
public function effectively_installed() |
19
|
|
|
{ |
20
|
|
|
return $this->db_tools->sql_column_exists($this->table_prefix . 'ads', 'ad_views'); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* {@inheritDoc} |
25
|
|
|
*/ |
26
|
|
|
public static function depends_on() |
27
|
|
|
{ |
28
|
|
|
return array( |
29
|
|
|
'\phpbb\ads\migrations\v10x\m1_initial_schema', |
30
|
|
|
'\phpbb\ads\migrations\v10x\m4_indexes', |
31
|
|
|
'\phpbb\ads\migrations\v10x\m5_end_date', |
32
|
|
|
'\phpbb\ads\migrations\v10x\m8_priority', |
33
|
|
|
); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Add the views and clicks to ads table |
38
|
|
|
* |
39
|
|
|
* @return array Array of table schema |
40
|
|
|
* @access public |
41
|
|
|
*/ |
42
|
|
|
public function update_schema() |
43
|
|
|
{ |
44
|
|
|
return array( |
45
|
|
|
'add_columns' => array( |
46
|
|
|
$this->table_prefix . 'ads' => array( |
47
|
|
|
'ad_views' => array('UINT', 0), |
48
|
|
|
'ad_clicks' => array('UINT', 0), |
49
|
|
|
'ad_views_limit' => array('UINT', 0), |
50
|
|
|
'ad_clicks_limit' => array('UINT', 0), |
51
|
|
|
), |
52
|
|
|
), |
53
|
|
|
); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Drop the views and clicks from ads table |
58
|
|
|
* |
59
|
|
|
* @return array Array of table schema |
60
|
|
|
* @access public |
61
|
|
|
*/ |
62
|
|
|
public function revert_schema() |
63
|
|
|
{ |
64
|
|
|
return array( |
65
|
|
|
'drop_columns' => array( |
66
|
|
|
$this->table_prefix . 'ads' => array( |
67
|
|
|
'ad_views', |
68
|
|
|
'ad_clicks', |
69
|
|
|
'ad_views_limit', |
70
|
|
|
'ad_clicks_limit', |
71
|
|
|
), |
72
|
|
|
), |
73
|
|
|
); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Add phpbb_ads_enable_views and phpbb_ads_enable_clicks config |
78
|
|
|
* |
79
|
|
|
* @return array Array of data update instructions |
80
|
|
|
*/ |
81
|
|
|
public function update_data() |
82
|
|
|
{ |
83
|
|
|
return array( |
84
|
|
|
array('config.add', array('phpbb_ads_enable_views', 0)), |
85
|
|
|
array('config.add', array('phpbb_ads_enable_clicks', 0)), |
86
|
|
|
); |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths