45 lines
1.5 KiB
PHP
45 lines
1.5 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('proposals', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->uuid('uuid')->unique();
|
|
$table->string('slug')->unique();
|
|
$table->string('title');
|
|
$table->string('client_name');
|
|
$table->string('client_email')->nullable();
|
|
$table->longText('content');
|
|
$table->decimal('total_price', 15, 2)->nullable();
|
|
$table->string('currency', 10)->default('TRY');
|
|
$table->string('status', 30)->default('draft'); // draft, sent, accepted, rejected, revised
|
|
$table->date('valid_until')->nullable();
|
|
$table->text('client_feedback')->nullable();
|
|
$table->string('accepted_name')->nullable();
|
|
$table->timestamp('accepted_at')->nullable();
|
|
$table->integer('views_count')->default(0);
|
|
$table->json('meta')->nullable(); // For accent color, logos, etc.
|
|
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('proposals');
|
|
}
|
|
};
|