40 lines
1.3 KiB
PHP
40 lines
1.3 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::create('appointments', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('reading_id')->nullable()->constrained('readings')->nullOnDelete();
|
|
$table->string('client_name', 150);
|
|
$table->string('client_email', 150);
|
|
$table->string('client_phone', 50)->nullable();
|
|
$table->enum('reading_type', ['free', 'profiling', 'quadrige']);
|
|
$table->enum('status', ['pending', 'confirmed', 'paid', 'canceled'])->default('pending');
|
|
$table->dateTime('scheduled_at');
|
|
$table->integer('duration_minutes')->default(60);
|
|
$table->decimal('price', 10, 2);
|
|
$table->enum('payment_status', ['unpaid', 'paid', 'refunded'])->default('unpaid');
|
|
$table->foreignId('payment_id')->nullable()->constrained('payments')->nullOnDelete();
|
|
$table->timestamps();
|
|
});
|
|
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('appointments');
|
|
}
|
|
};
|