From 9c2e9f2625a94934e814fbced18a9e17fce5b588 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Fri, 25 Sep 2020 09:03:22 +0200
Subject: [PATCH] Add missing table columns
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 core/Migrations/Version13000Date20170718121200.php | 14 ++++++++++++++
 core/Migrations/Version13000Date20170919121250.php | 13 +++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php
index 2a47bb52cfc..f830eebbbd2 100644
--- a/core/Migrations/Version13000Date20170718121200.php
+++ b/core/Migrations/Version13000Date20170718121200.php
@@ -122,6 +122,12 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
 			$table->addIndex(['root_id'], 'mounts_root_index');
 			$table->addIndex(['mount_id'], 'mounts_mount_id_index');
 			$table->addUniqueIndex(['user_id', 'root_id'], 'mounts_user_root_index');
+		} else {
+			$table = $schema->getTable('mounts');
+			$table->addColumn('mount_id', Types::BIGINT, [
+				'notnull' => false,
+				'length' => 20,
+			]);
 		}
 
 		if (!$schema->hasTable('mimetypes')) {
@@ -416,6 +422,14 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
 			$table->addIndex(['parent'], 'parent_index');
 			$table->addIndex(['uid_owner'], 'owner_index');
 			$table->addIndex(['uid_initiator'], 'initiator_index');
+		} else {
+			$table = $schema->getTable('share');
+			if (!$table->hasColumn('password')) {
+				$table->addColumn('password', 'string', [
+					'notnull' => false,
+					'length' => 255,
+				]);
+			}
 		}
 
 		if (!$schema->hasTable('jobs')) {
diff --git a/core/Migrations/Version13000Date20170919121250.php b/core/Migrations/Version13000Date20170919121250.php
index 330a0141eb8..284a509f5a2 100644
--- a/core/Migrations/Version13000Date20170919121250.php
+++ b/core/Migrations/Version13000Date20170919121250.php
@@ -63,8 +63,17 @@ class Version13000Date20170919121250 extends SimpleMigrationStep {
 		$column->setUnsigned(true);
 		$column = $table->getColumn('type');
 		$column->setUnsigned(true);
-		$column = $table->getColumn('remember');
-		$column->setUnsigned(true);
+		if ($table->hasColumn('remember')) {
+			$column = $table->getColumn('remember');
+			$column->setUnsigned(true);
+		} else {
+			$table->addColumn('remember', 'smallint', [
+				'notnull' => true,
+				'length' => 1,
+				'default' => 0,
+				'unsigned' => true,
+			]);
+		}
 		$column = $table->getColumn('last_activity');
 		$column->setUnsigned(true);
 		$column = $table->getColumn('last_check');
-- 
GitLab