|
@@ -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();
|
|
|
});
|
|
|
}
|