From c4e31a0d5e3d7c2c002fe5ebc5be1225e9c0b78b Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 27 Apr 2021 20:53:22 +0100 Subject: [PATCH] Updated hard-coded string lengths for indexed columns Since this is what's causing issues for people during migration due to max key lengths. Related to #2710. --- .../2017_03_19_091553_create_search_index_table.php | 2 +- .../2018_07_15_173514_add_role_external_auth_id.php | 2 +- .../migrations/2018_08_04_115700_create_bookshelves_table.php | 4 ++-- database/migrations/2021_03_08_215138_add_user_slug.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/database/migrations/2017_03_19_091553_create_search_index_table.php b/database/migrations/2017_03_19_091553_create_search_index_table.php index 7398ed398..a066fb130 100644 --- a/database/migrations/2017_03_19_091553_create_search_index_table.php +++ b/database/migrations/2017_03_19_091553_create_search_index_table.php @@ -15,7 +15,7 @@ class CreateSearchIndexTable extends Migration { Schema::create('search_terms', function (Blueprint $table) { $table->increments('id'); - $table->string('term', 200); + $table->string('term', 180); $table->string('entity_type', 100); $table->integer('entity_id'); $table->integer('score'); diff --git a/database/migrations/2018_07_15_173514_add_role_external_auth_id.php b/database/migrations/2018_07_15_173514_add_role_external_auth_id.php index 706a883a3..0778e8762 100644 --- a/database/migrations/2018_07_15_173514_add_role_external_auth_id.php +++ b/database/migrations/2018_07_15_173514_add_role_external_auth_id.php @@ -14,7 +14,7 @@ class AddRoleExternalAuthId extends Migration public function up() { Schema::table('roles', function (Blueprint $table) { - $table->string('external_auth_id', 200)->default(''); + $table->string('external_auth_id', 180)->default(''); $table->index('external_auth_id'); }); } diff --git a/database/migrations/2018_08_04_115700_create_bookshelves_table.php b/database/migrations/2018_08_04_115700_create_bookshelves_table.php index 9efba0071..488c61968 100644 --- a/database/migrations/2018_08_04_115700_create_bookshelves_table.php +++ b/database/migrations/2018_08_04_115700_create_bookshelves_table.php @@ -37,8 +37,8 @@ class CreateBookshelvesTable extends Migration Schema::create('bookshelves', function (Blueprint $table) { $table->increments('id'); - $table->string('name', 200); - $table->string('slug', 200); + $table->string('name', 180); + $table->string('slug', 180); $table->text('description'); $table->integer('created_by')->nullable()->default(null); $table->integer('updated_by')->nullable()->default(null); diff --git a/database/migrations/2021_03_08_215138_add_user_slug.php b/database/migrations/2021_03_08_215138_add_user_slug.php index 906e06b95..dad1e4227 100644 --- a/database/migrations/2021_03_08_215138_add_user_slug.php +++ b/database/migrations/2021_03_08_215138_add_user_slug.php @@ -15,7 +15,7 @@ class AddUserSlug extends Migration public function up() { Schema::table('users', function (Blueprint $table) { - $table->string('slug', 250); + $table->string('slug', 180); }); $slugMap = [];