adrema/database/migrations/2023_12_12_015320_create_in...

48 lines
1.2 KiB
PHP
Raw Normal View History

2023-12-13 00:35:39 +01:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->id();
$table->json('to');
$table->string('greeting');
$table->string('status');
2023-12-16 01:13:49 +01:00
$table->date('sent_at')->nullable();
2023-12-16 11:18:00 +01:00
$table->string('via');
2023-12-17 22:33:29 +01:00
$table->string('usage');
2023-12-13 00:35:39 +01:00
$table->timestamps();
});
Schema::create('invoice_positions', function (Blueprint $table) {
$table->id();
$table->foreignId('invoice_id');
$table->string('description');
$table->foreignId('member_id');
$table->unsignedBigInteger('price');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invoice_positions');
Schema::dropIfExists('invoices');
}
};