fix: 🐛 payments migration
This commit is contained in:
parent
ae47ebfcc6
commit
bd56c6b320
1 changed files with 7 additions and 4 deletions
|
@ -3,8 +3,10 @@
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class UpdateToPaymentTable extends Migration
|
|
||||||
|
class UpdateToPaymentsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
|
@ -13,11 +15,13 @@ class UpdateToPaymentTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('payment', function (Blueprint $table) {
|
Schema::table('payments', function (Blueprint $table) {
|
||||||
$table->string('payment_method');
|
$table->string('payment_method');
|
||||||
$table->dropColumn('payer');
|
$table->dropColumn('payer');
|
||||||
$table->dropColumn('payer_id');
|
$table->dropColumn('payer_id');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
DB::statement('UPDATE payments SET payment_method="paypal"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,10 +31,9 @@ class UpdateToPaymentTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('payment', function (Blueprint $table) {
|
Schema::table('payments', function (Blueprint $table) {
|
||||||
$table->dropColumn('payment_method');
|
$table->dropColumn('payment_method');
|
||||||
$table->string('payer_id')->nullable();
|
$table->string('payer_id')->nullable();
|
||||||
$table->string('payer_id')->nullable();
|
|
||||||
$table->text('payer')->nullable();
|
$table->text('payer')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue