Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
Version010301Date20210412152948
0.00% covered (danger)
0.00%
0 / 12
0.00% covered (danger)
0.00%
0 / 4
30
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 preSchemaChange
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 changeSchema
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
6
 postSchemaChange
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace OCA\Cospend\Migration;
6
7use Closure;
8use OCP\DB\ISchemaWrapper;
9use OCP\Migration\SimpleMigrationStep;
10use OCP\Migration\IOutput;
11use OCP\DB\QueryBuilder\IQueryBuilder;
12use OCP\IDBConnection;
13
14/**
15 * Auto-generated migration step: Please modify to your needs!
16 */
17class Version010301Date20210412152948 extends SimpleMigrationStep {
18
19    /** @var IDBConnection */
20    private $connection;
21
22    /**
23     * @param IDBConnection $connection
24     */
25    public function __construct(IDBConnection $connection) {
26        $this->connection = $connection;
27    }
28
29    /**
30     * @param IOutput $output
31     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
32     * @param array $options
33     */
34    public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
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        /** @var ISchemaWrapper $schema */
45        $schema = $schemaClosure();
46        $table = $schema->getTable('cospend_bills');
47        if (!$table->hasColumn('repeatfreq')) {
48            $table->addColumn('repeatfreq', 'integer', [
49                'notnull' => true,
50                'length' => 4,
51                'default' => 1,
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}