first commit

This commit is contained in:
Simon Pocrnjič
2024-10-28 21:08:16 +01:00
commit 90a5858320
199 changed files with 21177 additions and 0 deletions
@@ -0,0 +1,43 @@
<?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('account_types', function(Blueprint $table){
$table->id();
$table->string('name',50);
$table->string('description',125)->nullable();
$table->unsignedTinyInteger('deleted')->default(0);
$table->timestamps();
});
Schema::create('accounts', function (Blueprint $table) {
$table->id();
$table->string('reference', 125)->nullable();
$table->string('description', 255)->nullable();
$table->foreignIdFor(\App\Models\Contract::class);
$table->foreignId('type_id')->references('id')->on('account_types');
$table->unsignedTinyInteger('active')->default(1);
$table->unsignedTinyInteger('deleted')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('account_type');
Schema::dropIfExists('accounts');
}
};