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

Version4010Date20230815190000   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A postSchemaChange() 0 12 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\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
}