38 lines
1.1 KiB
PHP
38 lines
1.1 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('contracts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->string('reference')->unique()->nullable();
|
|
$table->string('provider');
|
|
$table->string('status')->default('draft'); // active, expired, pending, cancelled
|
|
$table->date('start_date');
|
|
$table->date('end_date')->nullable();
|
|
$table->decimal('amount', 10, 2)->nullable();
|
|
$table->string('currency', 3)->default('EUR');
|
|
$table->text('notes')->nullable();
|
|
$table->string('type')->default('other'); // microsoft_365, domain, software, fiber, other
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('contracts');
|
|
}
|
|
};
|