Browse Source

feat: ✨ Added payment table migration

IceToast 3 years ago
parent
commit
ae47ebfcc6

+ 2 - 1
database/migrations/2021_02_16_162655_create_payments_table.php

@@ -17,11 +17,12 @@ class CreatePaymentsTable extends Migration
             $table->uuid('id');
             $table->foreignId('user_id')->references('id')->on('users');
             $table->string('payment_id')->nullable();
-            $table->string('payment_method')->nullable();
+            $table->string('payer_id')->nullable();;
             $table->string('type')->nullable();;
             $table->string('status')->nullable();;
             $table->string('amount')->nullable();;
             $table->string('price')->nullable();;
+            $table->text('payer')->nullable();;
             $table->timestamps();
         });
     }

+ 37 - 0
database/migrations/2021_12_15_120346_update_to_payment_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class UpdateToPaymentTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('payment', function (Blueprint $table) {
+            $table->string('payment_method');
+            $table->dropColumn('payer');
+            $table->dropColumn('payer_id');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('payment', function (Blueprint $table) {
+            $table->dropColumn('payment_method');
+            $table->string('payer_id')->nullable();
+            $table->string('payer_id')->nullable();
+            $table->text('payer')->nullable();
+        });
+    }
+}