36 lines
1.0 KiB
PHP
36 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::create('readings', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->enum('reading_type', ['free', 'profiling', 'quadrige']);
|
|
$table->string('client_name', 150);
|
|
$table->string('client_email', 150);
|
|
$table->json('cards_drawn')->nullable();
|
|
$table->text('result_text')->nullable();
|
|
$table->decimal('price', 10, 2)->default(0.00);
|
|
$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('readings');
|
|
}
|
|
};
|