2017-12-13 01:52:24 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreateBidsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('user_bids', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
2017-12-13 03:26:08 +08:00
|
|
|
$table->unsignedInteger('user_id');
|
|
|
|
$table->string('flight_id', 12);
|
2017-12-13 01:52:24 +08:00
|
|
|
$table->timestamps();
|
|
|
|
|
|
|
|
$table->index('user_id');
|
|
|
|
$table->index(['user_id', 'flight_id']);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('user_bids');
|
|
|
|
}
|
|
|
|
}
|