Skip to content

Commit e5a0997

Browse files
Add primary key
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1 parent f167f8c commit e5a0997

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>End-to-End Encryption</name>
66
<summary>End-to-end encryption endpoint</summary>
77
<description>Provides the necessary endpoint to enable end-to-end encryption.</description>
8-
<version>1.10.0</version>
8+
<version>1.10.1</version>
99
<licence>agpl</licence>
1010
<author>Bjoern Schiessle</author>
1111
<namespace>EndToEndEncryption</namespace>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace OCA\EndToEndEncryption\Migration;
6+
7+
use Closure;
8+
use OCP\DB\ISchemaWrapper;
9+
use OCP\Migration\IOutput;
10+
use OCP\Migration\SimpleMigrationStep;
11+
12+
/**
13+
* Auto-generated migration step: Please modify to your needs!
14+
*/
15+
class Version1101Date20220316143119 extends SimpleMigrationStep
16+
{
17+
18+
/**
19+
* @param IOutput $output
20+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
21+
* @param array $options
22+
* @return null|ISchemaWrapper
23+
*/
24+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper
25+
{
26+
/** @var ISchemaWrapper $schema */
27+
$schema = $schemaClosure();
28+
$table = $schema->getTable('e2e_encryption_lock');
29+
30+
if (!$table->hasPrimaryKey()) {
31+
$table->setPrimaryKey(['id']);
32+
}
33+
34+
return $schema;
35+
}
36+
}

0 commit comments

Comments
 (0)