1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/database/migrations/2022_03_09_053508_transaction_events.php

56 lines
2.1 KiB
PHP
Raw Normal View History

2022-03-09 08:40:45 +01:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2022-06-21 12:03:51 +02:00
return new class extends Migration {
2022-03-09 08:40:45 +01:00
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transaction_events', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('client_id')->index();
$table->unsignedInteger('invoice_id');
$table->unsignedInteger('payment_id');
$table->unsignedInteger('credit_id');
$table->decimal('client_balance', 16, 4)->default(0);
$table->decimal('client_paid_to_date', 16, 4)->default(0);
$table->decimal('client_credit_balance', 16, 4)->default(0);
$table->decimal('invoice_balance', 16, 4)->default(0);
$table->decimal('invoice_amount', 16, 4)->default(0);
$table->decimal('invoice_partial', 16, 4)->default(0);
$table->decimal('invoice_paid_to_date', 16, 4)->default(0);
$table->unsignedInteger('invoice_status')->nullable();
$table->decimal('payment_amount', 16, 4)->default(0);
$table->decimal('payment_applied', 16, 4)->default(0);
$table->decimal('payment_refunded', 16, 4)->default(0);
$table->unsignedInteger('payment_status')->nullable();
$table->mediumText('paymentables')->nullable();
$table->unsignedInteger('event_id');
$table->unsignedInteger('timestamp');
$table->mediumText('payment_request')->nullable();
$table->mediumText('metadata')->nullable();
$table->decimal('credit_balance', 16, 4)->default(0);
$table->decimal('credit_amount', 16, 4)->default(0);
$table->unsignedInteger('credit_status')->nullable();
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade')->onUpdate('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
2022-06-21 12:02:20 +02:00
};