Passed
Push — master ( 668785...5f3868 )
by Marcel
02:53
created

Version020400Date20200623185352::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
 */
16
class Version020400Date20200623185352 extends SimpleMigrationStep
17
{
18
19
    /** @var IDBConnection */
20
    private $connection;
21
22
    public function __construct(IDBConnection $connection)
23
    {
24
        $this->connection = $connection;
25
    }
26
27
    /**
28
     * @param IOutput $output
29
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
30
     * @param array $options
31
     */
32
    public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
33
    {
34
    }
35
36
    /**
37
     * @param IOutput $output
38
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
     * @param array $options
40
     * @return null|ISchemaWrapper
41
     */
42
    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options)
43
    {
44
        /** @var ISchemaWrapper $schema */
45
        $schema = $schemaClosure();
46
47
        $table = $schema->getTable('analytics_dataset');
48
49
        $table->addColumn('dataoptions', 'string', [
50
            'notnull' => false,
51
            'length' => 1000,
52
        ]);
53
54
        return $schema;
55
    }
56
57
    /**
58
     * @param IOutput $output
59
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
60
     * @param array $options
61
     */
62
    public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
63
    {
64
    }
65
}
66