Create the projects part.

This commit is contained in:
2025-01-22 16:37:24 +01:00
parent 0e712a3412
commit 83cea92630
13 changed files with 829 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?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('projects', function (Blueprint $table) {
$table->id();
$table->foreignId('customer_id')->constrained();
$table->string('name');
$table->string('project_number');
$table->text('description')->nullable();
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('projects');
}
};

View File

@@ -0,0 +1,34 @@
<?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::table('invoices', function (Blueprint $table) {
$table->foreignId('project_id')->nullable()->constrained();
$table->integer('project_count')->nullable()->default(0);
$table->boolean('is_template')->default(false);
$table->string('currency_code')->default('EUR');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('invoices', function (Blueprint $table) {
$table->dropColumn('project_id');
$table->dropColumn('project_count');
$table->dropColumn('is_template');
$table->dropColumn('currency_code');
});
}
};