This repository has been archived on 2025-12-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Caramel-CRM-Backup/database/migrations/2025_09_18_190049_create_invoices_table.php
T

40 lines
1.2 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('invoices', function (Blueprint $table) {
$table->id();
$table->string('nr')->unique()->nullable();
$table->date('invoice_date');
$table->date('due_date')->nullable();
$table->date('service_start_date')->nullable();
$table->date('service_end_date')->nullable();
$table->boolean('is_recurring')->default(false);
$table->boolean('is_partial_service')->default(false);
$table->foreignId('customer_id')->nullable()->constrained()->onDelete('cascade');
$table->string('payment_status')->default('draft');
$table->decimal('total_amount', 10, 2);
$table->text('title')->nullable();
$table->text('text')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('invoices');
}
};