Files
exchange/database/migrations/2018_06_21_040652_create_invoice_table.php
T
2018-07-04 10:56:43 +08:00

42 lines
1002 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInvoiceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->increments('id');
$table->string('invoice_path');
$table->double('amount');
$table->integer('booking_id')->unsigned();
$table->foreign('booking_id')->references('id')->on('bookings');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoices', function(Blueprint $table)
{
$table->dropForeign('invoices_booking_id_foreign');
$table->dropColumn('booking_id');
});
Schema::dropIfExists('invoices');
}
}