Extend invoices and invoice items.

This commit is contained in:
2025-01-04 12:10:15 +01:00
parent 5b00aa8bb2
commit ede2939594
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?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('invoiceitems', function (Blueprint $table) {
$table->string('name')->after('invoice_id');
$table->text('description')->nullable()->after('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('invoiceitems', function (Blueprint $table) {
$table->dropColumn('name');
$table->dropColumn('description');
});
}
};

View File

@@ -0,0 +1,30 @@
<?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->decimal('tax', 8, 2)->default(0);
$table->decimal('sum', 8, 2)->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('invoices', function (Blueprint $table) {
$table->dropColumn('tax');
$table->dropColumn('sum');
});
}
};