From 39b0f464d2bf10e224d45c913fc9e575c0326ef9 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 14 Apr 2021 15:07:11 -0700 Subject: [PATCH] =?UTF-8?q?Adds=20ID=20columns=20to=20tables=20that=20don?= =?UTF-8?q?=E2=80=99t=20have=20them=20-=20reproduces=20#9363?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reproduces #9363 without the PK in custom fields Signed-off-by: snipe --- .../2021_04_14_180125_add_ids_to_tables.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 database/migrations/2021_04_14_180125_add_ids_to_tables.php diff --git a/database/migrations/2021_04_14_180125_add_ids_to_tables.php b/database/migrations/2021_04_14_180125_add_ids_to_tables.php new file mode 100644 index 0000000000..22cf03ebf9 --- /dev/null +++ b/database/migrations/2021_04_14_180125_add_ids_to_tables.php @@ -0,0 +1,54 @@ +increments('id'); + } + }); + + Schema::table('password_resets', function (Blueprint $table) { + // Add the id column to the password_resets table if it doesn't yet have one + if (!Schema::hasColumn('password_resets', 'id')) { + $table->increments('id'); + } + }); + + + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('migrations', function (Blueprint $table) { + if (Schema::hasColumn('migrations', 'id')) { + $table->dropColumn('id'); + } + }); + + Schema::table('password_resets', function (Blueprint $table) { + if (Schema::hasColumn('password_resets', 'id')) { + $table->dropColumn('id'); + } + }); + } +}