first commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?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('payment_types', function(Blueprint $table){
|
||||
$table->id();
|
||||
$table->string('name',50);
|
||||
$table->string('description',125)->nullable();
|
||||
$table->unsignedTinyInteger('deleted')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
});
|
||||
|
||||
Schema::create('payments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('reference', 125)->nullable();
|
||||
$table->string('payment_nu', 125)->nullable();
|
||||
$table->date('payment_date')->nullable();
|
||||
$table->decimal('amount',11,4)->nullable();
|
||||
$table->foreignId('debt_id')->references('id')->on('debts');
|
||||
$table->foreignId('type_id')->references('id')->on('payment_types');
|
||||
$table->unsignedTinyInteger('active')->default(1);
|
||||
$table->unsignedTinyInteger('deleted')->default(0);
|
||||
$table->foreignIdFor(\App\Models\User::class);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('payment_types');
|
||||
Schema::dropIfExists('payments');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user