mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 04:24:08 +00:00
42 lines
1002 B
PHP
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');
|
|
}
|
|
}
|