1
|
|
|
<?php |
2
|
|
|
namespace OCA\Polls\Migration; |
3
|
|
|
|
4
|
|
|
use Doctrine\DBAL\Exception\TableNotFoundException; |
|
|
|
|
5
|
|
|
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; |
|
|
|
|
6
|
|
|
use Doctrine\DBAL\Types\Type; |
|
|
|
|
7
|
|
|
use OCP\DB\ISchemaWrapper; |
|
|
|
|
8
|
|
|
use OCP\IDBConnection; |
9
|
|
|
use OCP\IConfig; |
10
|
|
|
use OCP\Migration\SimpleMigrationStep; |
|
|
|
|
11
|
|
|
use OCP\Migration\IOutput; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Adding timestamp to options table |
15
|
|
|
*/ |
16
|
|
|
class Version009000Date20180501201949 extends SimpleMigrationStep { |
17
|
|
|
/** @var IDBConnection */ |
18
|
|
|
protected $connection; |
19
|
|
|
|
20
|
|
|
/** @var IConfig */ |
21
|
|
|
protected $config; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @param IDBConnection $connection |
25
|
|
|
* @param IConfig $config |
26
|
|
|
*/ |
27
|
|
|
public function __construct(IDBConnection $connection, IConfig $config) { |
28
|
|
|
$this->connection = $connection; |
29
|
|
|
$this->config = $config; |
30
|
|
|
} |
31
|
|
|
/** |
32
|
|
|
* @param IOutput $output |
33
|
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
34
|
|
|
* @param array $options |
35
|
|
|
* @since 13.0.0 |
36
|
|
|
*/ |
37
|
|
|
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param IOutput $output |
42
|
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
43
|
|
|
* @param array $options |
44
|
|
|
* @return null|ISchemaWrapper |
45
|
|
|
* @since 13.0.0 |
46
|
|
|
*/ |
47
|
|
|
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
48
|
|
|
/** @var ISchemaWrapper $schema */ |
49
|
|
|
$schema = $schemaClosure(); |
50
|
|
|
|
51
|
|
|
$table = $schema->getTable('polls_options'); |
52
|
|
|
$table->addColumn('timestamp', Type::INTEGER, [ |
53
|
|
|
'notnull' => false, |
54
|
|
|
'default' => 0 |
55
|
|
|
]); |
56
|
|
|
|
57
|
|
|
return $schema; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param IOutput $output |
62
|
|
|
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
63
|
|
|
* @param array $options |
64
|
|
|
* @since 13.0.0 |
65
|
|
|
*/ |
66
|
|
|
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|
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