From fefaa78d4d1ee4a0e26514913076ea587f531562 Mon Sep 17 00:00:00 2001 From: Jelle Sebreghts Date: Tue, 30 Mar 2021 09:40:25 +0200 Subject: [PATCH 1/4] Add primary key to custom_field_custom_fieldset Some mysql clusters (like Percona-XtraDB-Cluster) prohibit the use of DML commands on a table. It's also just a good practice to add it. --- ...02_add_custom_field_custom_fieldset_pk.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 database/migrations/2021_03_29_120402_add_custom_field_custom_fieldset_pk.php diff --git a/database/migrations/2021_03_29_120402_add_custom_field_custom_fieldset_pk.php b/database/migrations/2021_03_29_120402_add_custom_field_custom_fieldset_pk.php new file mode 100644 index 000000000000..b8b3c9151d7e --- /dev/null +++ b/database/migrations/2021_03_29_120402_add_custom_field_custom_fieldset_pk.php @@ -0,0 +1,32 @@ +primary(['custom_field_id', 'custom_fieldset_id'], 'custom_field_custom_fieldset_primary'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('custom_field_custom_fieldset', function (Blueprint $table) { + $table->dropPrimary('custom_field_custom_fieldset_primary'); + }); + } +} From 303a614ad1e17e2bc28d45c16cf44c79e0db0dc2 Mon Sep 17 00:00:00 2001 From: Jelle Sebreghts Date: Tue, 30 Mar 2021 09:41:05 +0200 Subject: [PATCH 2/4] Add primary key to migrations table if it doesn't exist yet Some mysql clusters (like Percona-XtraDB-Cluster) prohibit the use of DML commands on a table. It's also just a good practice to add it. See https://github.com/laravel/framework/pull/15770 --- .../2021_03_29_124623_add_migrations_pk.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 database/migrations/2021_03_29_124623_add_migrations_pk.php diff --git a/database/migrations/2021_03_29_124623_add_migrations_pk.php b/database/migrations/2021_03_29_124623_add_migrations_pk.php new file mode 100644 index 000000000000..264f80e2491f --- /dev/null +++ b/database/migrations/2021_03_29_124623_add_migrations_pk.php @@ -0,0 +1,33 @@ +increments('id'); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } +} From e159f6a31a6b8b12f7301ac41a3c7b83172366f9 Mon Sep 17 00:00:00 2001 From: Jelle Sebreghts Date: Tue, 30 Mar 2021 09:43:25 +0200 Subject: [PATCH 3/4] Add primary key to the password_resets table Some mysql clusters (like Percona-XtraDB-Cluster) prohibit the use of DML commands on a table. It's also just a good practice to add it. --- ...21_03_30_094127_add_password_resets_pk.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 database/migrations/2021_03_30_094127_add_password_resets_pk.php diff --git a/database/migrations/2021_03_30_094127_add_password_resets_pk.php b/database/migrations/2021_03_30_094127_add_password_resets_pk.php new file mode 100644 index 000000000000..57b7735e1462 --- /dev/null +++ b/database/migrations/2021_03_30_094127_add_password_resets_pk.php @@ -0,0 +1,32 @@ +increments('id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('password_resets', function (Blueprint $table) { + $table->dropColumn('id'); + }); + } +} From 30fd4df32a0a51f6a2d78d0385ba1d305fa9ab1a Mon Sep 17 00:00:00 2001 From: Jelle Sebreghts Date: Tue, 30 Mar 2021 09:47:41 +0200 Subject: [PATCH 4/4] Fix the code comment in add_migrations_pk migration --- database/migrations/2021_03_29_124623_add_migrations_pk.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/database/migrations/2021_03_29_124623_add_migrations_pk.php b/database/migrations/2021_03_29_124623_add_migrations_pk.php index 264f80e2491f..b9bba80becca 100644 --- a/database/migrations/2021_03_29_124623_add_migrations_pk.php +++ b/database/migrations/2021_03_29_124623_add_migrations_pk.php @@ -14,8 +14,7 @@ class AddMigrationsPk extends Migration public function up() { Schema::table('migrations', function (Blueprint $table) { - // Add the new id and batch columns to the migrations table if they - // don't exist yet + // Add the id column to the migrations table if it doesn't yet. if (!Schema::hasColumn('migrations', 'id')) { $table->increments('id'); }