1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace OCA\Analytics\Migration; |
6
|
|
|
|
7
|
|
|
use Closure; |
8
|
|
|
use Doctrine\DBAL\Types\Type; |
|
|
|
|
9
|
|
|
use OCP\DB\ISchemaWrapper; |
|
|
|
|
10
|
|
|
use OCP\DB\Types; |
|
|
|
|
11
|
|
|
use OCP\IDBConnection; |
|
|
|
|
12
|
|
|
use OCP\Migration\IOutput; |
|
|
|
|
13
|
|
|
use OCP\Migration\SimpleMigrationStep; |
|
|
|
|
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Auto-generated migration step: Please modify to your needs! |
17
|
|
|
* sudo -u www-data php occ migrations:execute analytics 4012Date20231108180000 |
18
|
|
|
*/ |
19
|
|
|
class Version4012Date20231108180000 extends SimpleMigrationStep |
20
|
|
|
{ |
21
|
|
|
|
22
|
|
|
/** @var IDBConnection */ |
23
|
|
|
private $connection; |
24
|
|
|
|
25
|
|
|
public function __construct(IDBConnection $connection) |
26
|
|
|
{ |
27
|
|
|
$this->connection = $connection; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @param IOutput $output |
32
|
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
33
|
|
|
* @param array $options |
34
|
|
|
* @return null|ISchemaWrapper |
35
|
|
|
*/ |
36
|
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) |
37
|
|
|
{ |
38
|
|
|
/** @var ISchemaWrapper $schema */ |
39
|
|
|
$schema = $schemaClosure(); |
40
|
|
|
|
41
|
|
|
if (!$schema->hasTable('analytics_panorama')) { |
42
|
|
|
$table = $schema->createTable('analytics_panorama'); |
43
|
|
|
$table->addColumn('id', 'integer', [ |
44
|
|
|
'autoincrement' => true, |
45
|
|
|
'notnull' => true, |
46
|
|
|
]); |
47
|
|
|
$table->addColumn('user_id', 'string', [ |
48
|
|
|
'notnull' => true, |
49
|
|
|
'length' => 64, |
50
|
|
|
]); |
51
|
|
|
$table->addColumn('name', 'string', [ |
52
|
|
|
'notnull' => true, |
53
|
|
|
'length' => 64, |
54
|
|
|
]); |
55
|
|
|
$table->addColumn('type', 'integer', [ |
56
|
|
|
'notnull' => false, |
57
|
|
|
]); |
58
|
|
|
$table->addColumn('parent', 'integer', [ |
59
|
|
|
'notnull' => false, |
60
|
|
|
]); |
61
|
|
|
$table->addColumn('pages', 'text', [ |
62
|
|
|
'notnull' => false, |
63
|
|
|
]); |
64
|
|
|
$table->setPrimaryKey(['id']); |
65
|
|
|
$table->addIndex(['user_id'], 'analytics_panorama_user_id_idx'); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
return $schema; |
69
|
|
|
} |
70
|
|
|
} |
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