Files
izyim/database/migrations/2019_07_31_181217_create_invoices_table.php
T
Omair Saleh 0e5f2939e3 large commit
2019-10-05 13:09:26 +08:00

42 lines
1.1 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInvoicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->increments('id');
$table->integer('order_id')->unsigned()->index();
$table->integer('company_id')->unsigned()->index();
$table->decimal('currency', 13, 3);
$table->decimal('total', 13, 3);
$table->decimal('tax', 13, 3)->default(0);
$table->date('due_date')->nullable();
$table->decimal('total_paid', 13, 3);
$table->boolean('status')->default(0);
$table->timestamps();
$table->foreign('order_id')->references('id')->on('orders');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invoices');
}
}