add payment option
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (! Schema::hasTable('bookings')) {
|
||||
Schema::create('bookings', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('account_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('payment_id')->nullable()->constrained('payments')->nullOnDelete();
|
||||
$table->bigInteger('amount_cents');
|
||||
$table->enum('type', ['debit', 'credit']);
|
||||
$table->string('description')->nullable();
|
||||
$table->timestamp('booked_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->index(['account_id', 'booked_at']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('bookings');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user