1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2017 Joas Schilling <[email protected]> |
4
|
|
|
* |
5
|
|
|
* @author Joas Schilling <[email protected]> |
6
|
|
|
* |
7
|
|
|
* @license GNU AGPL version 3 or any later version |
8
|
|
|
* |
9
|
|
|
* This program is free software: you can redistribute it and/or modify |
10
|
|
|
* it under the terms of the GNU Affero General Public License as |
11
|
|
|
* published by the Free Software Foundation, either version 3 of the |
12
|
|
|
* License, or (at your option) any later version. |
13
|
|
|
* |
14
|
|
|
* This program is distributed in the hope that it will be useful, |
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
* GNU Affero General Public License for more details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU Affero General Public License |
20
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
21
|
|
|
* |
22
|
|
|
*/ |
23
|
|
|
namespace OCA\Polls\Migration; |
24
|
|
|
|
25
|
|
|
use Doctrine\DBAL\Exception\TableNotFoundException; |
|
|
|
|
26
|
|
|
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; |
|
|
|
|
27
|
|
|
use Doctrine\DBAL\Types\Type; |
|
|
|
|
28
|
|
|
use OCP\DB\ISchemaWrapper; |
|
|
|
|
29
|
|
|
use OCP\IConfig; |
30
|
|
|
use OCP\IDBConnection; |
31
|
|
|
use OCP\Migration\SimpleMigrationStep; |
|
|
|
|
32
|
|
|
use OCP\Migration\IOutput; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Auto-generated migration step: Please modify to your needs! |
36
|
|
|
* Adding column 'disallow_maybe' to table 'polls_events' |
37
|
|
|
*/ |
38
|
|
|
class Version009000Date20180421050115 extends SimpleMigrationStep { |
39
|
|
|
/** @var IDBConnection */ |
40
|
|
|
protected $connection; |
41
|
|
|
|
42
|
|
|
/** @var IConfig */ |
43
|
|
|
protected $config; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @param IDBConnection $connection |
47
|
|
|
* @param IConfig $config |
48
|
|
|
*/ |
49
|
|
|
public function __construct(IDBConnection $connection, IConfig $config) { |
50
|
|
|
$this->connection = $connection; |
51
|
|
|
$this->config = $config; |
52
|
|
|
} |
53
|
|
|
/** |
54
|
|
|
* @param IOutput $output |
55
|
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
56
|
|
|
* @param array $options |
57
|
|
|
* @since 13.0.0 |
58
|
|
|
*/ |
59
|
|
|
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @param IOutput $output |
64
|
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
65
|
|
|
* @param array $options |
66
|
|
|
* @return null|ISchemaWrapper |
67
|
|
|
* @since 13.0.0 |
68
|
|
|
*/ |
69
|
|
|
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
70
|
|
|
/** @var ISchemaWrapper $schema */ |
71
|
|
|
$schema = $schemaClosure(); |
72
|
|
|
|
73
|
|
|
$table = $schema->getTable('polls_events'); |
74
|
|
|
$table->addColumn('disallow_maybe', Type::INTEGER, [ |
75
|
|
|
'notnull' => false, |
76
|
|
|
'default' => 0 |
77
|
|
|
]); |
78
|
|
|
|
79
|
|
|
return $schema; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @param IOutput $output |
84
|
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
85
|
|
|
* @param array $options |
86
|
|
|
* @since 13.0.0 |
87
|
|
|
*/ |
88
|
|
|
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { |
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|
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