From bd56c6b320ae06d4e442b0898d660bb9d4746e85 Mon Sep 17 00:00:00 2001 From: IceToast Date: Wed, 15 Dec 2021 13:30:32 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20payments=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...=> 2021_12_15_120346_update_to_payments_table.php} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename database/migrations/{2021_12_15_120346_update_to_payment_table.php => 2021_12_15_120346_update_to_payments_table.php} (70%) diff --git a/database/migrations/2021_12_15_120346_update_to_payment_table.php b/database/migrations/2021_12_15_120346_update_to_payments_table.php similarity index 70% rename from database/migrations/2021_12_15_120346_update_to_payment_table.php rename to database/migrations/2021_12_15_120346_update_to_payments_table.php index 81a4be8d..64ffa612 100644 --- a/database/migrations/2021_12_15_120346_update_to_payment_table.php +++ b/database/migrations/2021_12_15_120346_update_to_payments_table.php @@ -3,8 +3,10 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\DB; -class UpdateToPaymentTable extends Migration + +class UpdateToPaymentsTable extends Migration { /** * Run the migrations. @@ -13,11 +15,13 @@ class UpdateToPaymentTable extends Migration */ public function up() { - Schema::table('payment', function (Blueprint $table) { + Schema::table('payments', function (Blueprint $table) { $table->string('payment_method'); $table->dropColumn('payer'); $table->dropColumn('payer_id'); }); + + DB::statement('UPDATE payments SET payment_method="paypal"'); } /** @@ -27,10 +31,9 @@ class UpdateToPaymentTable extends Migration */ public function down() { - Schema::table('payment', function (Blueprint $table) { + Schema::table('payments', function (Blueprint $table) { $table->dropColumn('payment_method'); $table->string('payer_id')->nullable(); - $table->string('payer_id')->nullable(); $table->text('payer')->nullable(); }); }