From ead5920cfc12b7063e64645b92bc9d2e6c4c5ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 12 Nov 2020 13:04:48 +0100 Subject: Add migration to bigint columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Migration/Version2060Date20200302131958.php | 28 ++++++++++++------------ lib/Migration/Version2060Date20200302132145.php | 10 +++++---- lib/Migration/Version30704Date20200626072306.php | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) (limited to 'lib') diff --git a/lib/Migration/Version2060Date20200302131958.php b/lib/Migration/Version2060Date20200302131958.php index 567a7f2b..29f90bbd 100644 --- a/lib/Migration/Version2060Date20200302131958.php +++ b/lib/Migration/Version2060Date20200302131958.php @@ -26,7 +26,7 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { if (!$schema->hasTable('richdocuments_wopi')) { $table = $schema->createTable('richdocuments_wopi'); - $table->addColumn('id', 'integer', [ + $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, @@ -44,11 +44,11 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { 'notnull' => false, 'length' => 64, ]); - $table->addColumn('fileid', 'integer', [ + $table->addColumn('fileid', 'bigint', [ 'notnull' => true, 'length' => 20, ]); - $table->addColumn('version', 'integer', [ + $table->addColumn('version', 'bigint', [ //'notnull' => true, 'notnull' => false, 'length' => 20, @@ -69,16 +69,16 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { 'length' => 32, 'default' => '', ]); - $table->addColumn('expiry', 'integer', [ + $table->addColumn('expiry', 'bigint', [ 'notnull' => false, 'length' => 20, 'unsigned' => true, ]); - $table->addColumn('template_destination', 'integer', [ + $table->addColumn('template_destination', 'bigint', [ 'notnull' => false, 'length' => 20, ]); - $table->addColumn('template_id', 'integer', [ + $table->addColumn('template_id', 'bigint', [ 'notnull' => false, 'length' => 20, ]); @@ -114,7 +114,7 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { if (!$schema->hasTable('richdocuments_direct')) { $table = $schema->createTable('richdocuments_direct'); - $table->addColumn('id', 'integer', [ + $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, @@ -128,22 +128,22 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { 'notnull' => false, 'length' => 64, ]); - $table->addColumn('fileid', 'integer', [ + $table->addColumn('fileid', 'bigint', [ 'notnull' => true, 'length' => 20, ]); - $table->addColumn('timestamp', 'integer', [ + $table->addColumn('timestamp', 'bigint', [ // 'notnull' => true, 'notnull' => false, 'length' => 20, 'default' => 0, 'unsigned' => true, ]); - $table->addColumn('template_destination', 'integer', [ + $table->addColumn('template_destination', 'bigint', [ 'notnull' => false, 'length' => 20, ]); - $table->addColumn('template_id', 'integer', [ + $table->addColumn('template_id', 'bigint', [ 'notnull' => false, 'length' => 20, ]); @@ -154,7 +154,7 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { if (!$schema->hasTable('richdocuments_assets')) { $table = $schema->createTable('richdocuments_assets'); - $table->addColumn('id', 'integer', [ + $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, @@ -164,7 +164,7 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { 'notnull' => false, 'length' => 64, ]); - $table->addColumn('fileid', 'integer', [ + $table->addColumn('fileid', 'bigint', [ 'notnull' => true, 'length' => 20, ]); @@ -172,7 +172,7 @@ class Version2060Date20200302131958 extends SimpleMigrationStep { 'notnull' => false, 'length' => 64, ]); - $table->addColumn('timestamp', 'integer', [ + $table->addColumn('timestamp', 'bigint', [ // 'notnull' => true, 'notnull' => false, 'length' => 20, diff --git a/lib/Migration/Version2060Date20200302132145.php b/lib/Migration/Version2060Date20200302132145.php index 766dbb14..6663eb63 100644 --- a/lib/Migration/Version2060Date20200302132145.php +++ b/lib/Migration/Version2060Date20200302132145.php @@ -24,10 +24,12 @@ class Version2060Date20200302132145 extends SimpleMigrationStep $schema = $schemaClosure(); $table = $schema->getTable('richdocuments_wopi'); - $table->addColumn('share', 'string', [ - 'notnull' => false, - 'length' => 64 - ]); + if (!$table->hasColumn('share')) { + $table->addColumn('share', 'string', [ + 'notnull' => false, + 'length' => 64 + ]); + } return $schema; } diff --git a/lib/Migration/Version30704Date20200626072306.php b/lib/Migration/Version30704Date20200626072306.php index bb9efa40..5219cf9f 100644 --- a/lib/Migration/Version30704Date20200626072306.php +++ b/lib/Migration/Version30704Date20200626072306.php @@ -24,7 +24,7 @@ class Version30704Date20200626072306 extends SimpleMigrationStep { $table = $schema->getTable('richdocuments_wopi'); if (!$table->hasColumn('template_id')) { - $table->addColumn('template_id', 'integer', [ + $table->addColumn('template_id', 'bigint', [ 'notnull' => false, 'length' => 20, ]); -- cgit v1.2.3