Passed
Push — master ( bf9f08...4520d5 )
by Marcel
04:12
created

Version4010Date20230815190000::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace OCA\Analytics\Migration;
6
7
use Closure;
8
use OCP\DB\Exception;
9
use OCP\DB\ISchemaWrapper;
10
use OCP\IDBConnection;
11
use OCP\Migration\IOutput;
12
use OCP\Migration\SimpleMigrationStep;
13
14
/**
15
 * Auto-generated migration step: Please modify to your needs!
16
 * sudo -u www-data php /var/www/nextcloud/occ migrations:execute analytics 4009Date20230517190000
17
 */
18
class Version4010Date20230815190000 extends SimpleMigrationStep
19
{
20
21
    /** @var IDBConnection */
22
    private $connection;
23
24
    public function __construct(IDBConnection $connection)
25
    {
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
     * @throws Exception
34
     */
35
    public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
36
    {
37
        $query = $this->connection->getQueryBuilder();
38
        $query->insert('analytics_whats_new')
39
            ->values([
40
                'version' => $query->createNamedParameter('4.10.0'),
41
                'data' => $query->createNamedParameter('{"changelogURL":"https:\/\/github.com\/rello\/analytics\/blob\/master\/CHANGELOG.md","whatsNew":{
42
"en":{"regular":["Translation integration","Custom columns in column picker","List available values for input boxes"],"admin":["New Features apply to users"]},
43
"de":{"regular":["Translation Integration","Benutzerdefinierte Spalten im Column Picker","Eingabehilfe in Formularfeldern"],"admin":["Nur User Features"]}
44
}}'),
45
            ])
46
            ->executeStatement();
47
    }
48
}