|
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 Version020401Date20200710185352 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
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @param IOutput $output |
|
48
|
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
49
|
|
|
* @param array $options |
|
50
|
|
|
*/ |
|
51
|
|
|
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) |
|
52
|
|
|
{ |
|
53
|
|
|
$query = $this->connection->getQueryBuilder(); |
|
54
|
|
|
$query->insert('analytics_whats_new') |
|
55
|
|
|
->values([ |
|
56
|
|
|
'version' => $query->createNamedParameter('2.4.1'), |
|
57
|
|
|
'data' => $query->createNamedParameter('{"changelogURL":"https:\/\/github.com\/rello\/analytics\/blob\/master\/CHANGELOG.md","whatsNew":{ |
|
58
|
|
|
"en":{"regular":["Combined charts","Filter reports or change the drilldown (internal reports only)","Changes are persisted with the report","This WhatsNew popup"],"admin":["New Features apply to users"]}, |
|
59
|
|
|
"de":{"regular":["Kombinierte Diagramme","Filter oder Aufriss ändern (nur interne Berichte)","Änderungen werden im Report gespeichert","Dieses WhatsNew Fenster"],"admin":["Nur User Features"]} |
|
60
|
|
|
}}'), |
|
61
|
|
|
]) |
|
62
|
|
|
->execute(); |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|