mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreatePaymentsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('payments', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->string('payment_number');
|
|
$table->string('payment_mode')->nullable();
|
|
$table->date('payment_date');
|
|
$table->text('notes')->nullable();
|
|
$table->unsignedBigInteger('amount');
|
|
$table->integer('user_id')->unsigned();
|
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
|
$table->integer('invoice_id')->unsigned()->nullable();
|
|
$table->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade');
|
|
$table->integer('company_id')->unsigned()->nullable();
|
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('payments');
|
|
}
|
|
}
|