Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntipkin-A <Artem.Antipkin@onlyoffice.com>2022-09-29 15:09:33 +0300
committerAntipkin-A <Artem.Antipkin@onlyoffice.com>2022-09-29 15:15:47 +0300
commit3f043fb7772e8ba5efeae44e87cc3c7443fdb10b (patch)
tree8982d118a4b2f20118faa5937218381ac4800688
parent61121e80258fd6534f90114c22256c9c3814b48d (diff)
changed migration for permissions table (Fix #697 Fix #708)feature/migration-fix
-rw-r--r--lib/Migration/Version070400Date20220929111111.php89
1 files changed, 89 insertions, 0 deletions
diff --git a/lib/Migration/Version070400Date20220929111111.php b/lib/Migration/Version070400Date20220929111111.php
new file mode 100644
index 0000000..0a9563d
--- /dev/null
+++ b/lib/Migration/Version070400Date20220929111111.php
@@ -0,0 +1,89 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OCA\Onlyoffice\Migration;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+/**
+ * Auto-generated migration step: Please modify to your needs!
+ */
+class Version070400Date20220929111111 extends SimpleMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ */
+ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
+ }
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ if (!$schema->hasTable('onlyoffice_filekey')) {
+ $table = $schema->createTable('onlyoffice_filekey');
+ $table->addColumn('id', 'integer', [
+ 'autoincrement' => true,
+ 'notnull' => true,
+ ]);
+ $table->addColumn('file_id', 'bigint', [
+ 'notnull' => false,
+ 'default' => '-1',
+ ]);
+ $table->addColumn('key', 'string', [
+ 'notnull' => true,
+ 'length' => 128,
+ ]);
+ $table->addColumn('lock', 'integer', [
+ 'notnull' => true,
+ 'default' => 0,
+ ]);
+ $table->addColumn('fs', 'integer', [
+ 'notnull' => true,
+ 'default' => 0,
+ ]);
+ $table->setPrimaryKey(['id']);
+ $table->addUniqueIndex(['file_id'], 'file_id_index');
+ }
+
+ if (!$schema->hasTable('onlyoffice_permissions')) {
+ $table = $schema->createTable('onlyoffice_permissions');
+ $table->addColumn('id', 'integer', [
+ 'autoincrement' => true,
+ 'notnull' => true,
+ ]);
+ $table->addColumn('share_id', 'bigint', [
+ 'notnull' => true,
+ 'default' => '-1',
+ ]);
+ $table->addColumn('permissions', 'integer', [
+ 'notnull' => true,
+ 'default' => 0,
+ ]);
+ $table->setPrimaryKey(['id']);
+ $table->addUniqueIndex(['share_id'], 'onlyoffice_share_id_index');
+ }
+
+ return $schema;
+ }
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ */
+ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
+ }
+}