cotizaweb/database/migrations/2026_02_07_212028_create_cotizacions_table.php
jesusfb 161fcee049
Some checks are pending
Deploy to EC2 cotiza / deploy (push) Waiting to run
first commit
2026-04-24 12:53:27 -07:00

42 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('cotizaciones', function (Blueprint $table) {
$table->id();
$table->foreignId('company_id')->constrained()->cascadeOnDelete();
$table->foreignId('cliente_id')->constrained()->cascadeOnDelete();
$table->string('token')->unique(); // link público
$table->enum('estado', ['pendiente','vista','aprobada','rechazada'])
->default('pendiente');
$table->timestamp('aprobada_en')->nullable();
$table->string('aprobada_por')->nullable();
$table->decimal('subtotal', 10, 2)->default(0);
$table->decimal('iva', 10, 2)->default(0);
$table->decimal('total', 10, 2)->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cotizacions');
}
};