KSA-ORACLE-ALLACCESSKEYS/database/migrations/2025_09_08_194556_edit_table_payments.php
Nyavokevin 9e5cc5ab1a
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
add dark theme
2025-09-18 20:34:07 +03:00

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');
});
}
};