diff options
Diffstat (limited to 'lib/Migration/Version30717Date20210310164901.php')
-rw-r--r-- | lib/Migration/Version30717Date20210310164901.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Migration/Version30717Date20210310164901.php b/lib/Migration/Version30717Date20210310164901.php new file mode 100644 index 00000000..21bb289b --- /dev/null +++ b/lib/Migration/Version30717Date20210310164901.php @@ -0,0 +1,34 @@ +<?php + +declare(strict_types=1); + +namespace OCA\Richdocuments\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +class Version30717Date20210310164901 extends SimpleMigrationStep { + + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + $table = $schema->getTable('richdocuments_wopi'); + + if (!$table->hasColumn('token_type')) { + $table->addColumn('token_type', 'integer', [ + 'notnull' => false, + 'length' => 4, + 'default' => 0, + ]); + } + if ($table->hasColumn('is_remote_token')) { + $table->dropColumn('is_remote_token'); + } + + return $schema; + } + +} |