40 lines
1.2 KiB
PHP
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');
|
|
}
|
|
};
|