37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::table('payments', function (Blueprint $table) {
|
|
// Modify the status enum to include 'processed'
|
|
$table->enum('status', ['pending', 'succeeded', 'failed', 'refunded', 'processed'])->default('pending')->change();
|
|
|
|
// Add the cards JSON column
|
|
$table->json('cards')->nullable()->after('status');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::table('payments', function (Blueprint $table) {
|
|
// Revert the status enum to its original values
|
|
$table->enum('status', ['pending', 'succeeded', 'failed', 'refunded'])->default('pending')->change();
|
|
|
|
// Remove the cards column
|
|
$table->dropColumn('cards');
|
|
});
|
|
}
|
|
};
|