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

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKERIOU Samir <samir.keriou@gendarmerie.interieur.gouv.fr>2020-06-24 12:41:10 +0300
committerKERIOU Samir <samir.keriou@gendarmerie.interieur.gouv.fr>2020-07-07 15:20:52 +0300
commit91aa8c52613fcc1c6ebdfbf5cf80da8f0bb224d2 (patch)
tree2c5e0bfab877585dab1957a53373f6a3c7028851 /lib
parent46a3c94ddfee1448591a7edf72bb0027005dd82e (diff)
Fix bug #1054
Signed-off-by: KERIOU Samir <samir.keriou@gendarmerie.interieur.gouv.fr>
Diffstat (limited to 'lib')
-rw-r--r--lib/Migration/Version2060Date20200302132145.php86
1 files changed, 66 insertions, 20 deletions
diff --git a/lib/Migration/Version2060Date20200302132145.php b/lib/Migration/Version2060Date20200302132145.php
index 9869e5ad..71c34873 100644
--- a/lib/Migration/Version2060Date20200302132145.php
+++ b/lib/Migration/Version2060Date20200302132145.php
@@ -11,23 +11,69 @@ use OCP\Migration\SimpleMigrationStep;
class Version2060Date20200302132145 extends SimpleMigrationStep {
- /**
- * @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) {
- /** @var ISchemaWrapper $schema */
- $schema = $schemaClosure();
-
- $table = $schema->getTable('richdocuments_wopi');
- $table->addColumn('share', 'string', [
- 'notnull' => false,
- 'length' => 64
- ]);
-
- return $schema;
- }
-
-}
+ /**
+ * @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) {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $table = $schema->getTable('richdocuments_wopi');
+
+ if(!$table->hasColumn('template_id')) {
+ $table->addColumn('template_id', 'integer', [
+ 'notnull' => false,
+ 'length' => 4,
+ ]);
+ }
+
+ if(!$table->hasColumn('hide_download')) {
+ $table->addColumn('hide_download', 'boolean', [
+ 'notnull' => true,
+ 'default' => false,
+ ]);
+ }
+
+ if(!$table->hasColumn('share')) {
+ $table->addColumn('share', 'string', [
+ 'notnull' => false,
+ 'length' => 64
+ ]);
+ }
+
+ if(!$table->hasColumn('direct')) {
+ $table->addColumn('direct', 'boolean', [
+ 'notnull' => true,
+ 'default' => false,
+ ]);
+ }
+ if(!$table->hasColumn('is_remote_token')) {
+ $table->addColumn('is_remote_token', 'boolean', [
+ 'notnull' => true,
+ 'default' => false,
+ ]);
+ }
+
+ if(!$table->hasColumn('remote_server')) {
+ $table->addColumn('remote_server', 'string', [
+ 'notnull' => true,
+ 'default' => '',
+ ]);
+
+ }
+ if(!$table->hasColumn('remote_server_token')) {
+ $table->addColumn('remote_server_token', 'string', [
+ 'notnull' => true,
+ 'length' => 32,
+ 'default' => '',
+ ]);
+ }
+
+
+ return $schema;
+ }
+
+} \ No newline at end of file