Passed
Push — master ( 9eb97a...9cfbc1 )
by Marcel
02:28
created

Version030201Date20210129200000   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 42
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A preSchemaChange() 0 2 1
A postSchemaChange() 0 2 1
A changeSchema() 0 7 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace OCA\Analytics\Migration;
6
7
use Closure;
8
use OCP\DB\ISchemaWrapper;
9
use OCP\IDBConnection;
10
use OCP\Migration\IOutput;
11
use OCP\Migration\SimpleMigrationStep;
12
13
/**
14
 * Auto-generated migration step: Please modify to your needs!
15
 * sudo -u www-data php /var/www/nextcloud/occ migrations:execute analytics 030201Date20210129200000
16
 */
17
class Version030201Date20210129200000 extends SimpleMigrationStep
18
{
19
20
    /** @var IDBConnection */
21
    private $connection;
22
23
    public function __construct(IDBConnection $connection)
24
    {
25
        $this->connection = $connection;
26
    }
27
28
    /**
29
     * @param IOutput $output
30
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
31
     * @param array $options
32
     */
33
    public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
34
    {
35
    }
36
37
    /**
38
     * @param IOutput $output
39
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
40
     * @param array $options
41
     * @return null|ISchemaWrapper
42
     */
43
    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options)
44
    {
45
        /** @var ISchemaWrapper $schema */
46
        $schema = $schemaClosure();
47
        $table = $schema->getTable('analytics_dataset');
48
        $table->getColumn('link')->setLength(500);
49
        return $schema;
50
    }
51
52
    /**
53
     * @param IOutput $output
54
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
55
     * @param array $options
56
     */
57
    public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
58
    {
59
    }
60
}
61