119 lines
6 KiB
PHP
119 lines
6 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
/**
|
|
* Migration auto-generated by Sequel Pro Laravel Export (1.4.1)
|
|
* @see https://github.com/cviebrock/sequel-pro-laravel-export
|
|
*/
|
|
class CreateBookingTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('booking', function (Blueprint $table) {
|
|
$table->bigIncrements('id');
|
|
$table->date('booking_date')->nullable();
|
|
$table->bigInteger('customer_id');
|
|
$table->bigInteger('lead_id')->nullable();
|
|
$table->tinyInteger('new_drafts')->nullable()->default(0);
|
|
$table->integer('sf_guard_user_id');
|
|
$table->bigInteger('branch_id');
|
|
$table->decimal('service_fee', 10, 2)->nullable()->default(0.00);
|
|
$table->bigInteger('travel_country_id')->nullable();
|
|
$table->bigInteger('travel_category_id')->nullable();
|
|
$table->bigInteger('pax')->nullable();
|
|
$table->bigInteger('coupon_id')->nullable();
|
|
$table->string('title', 255)->nullable();
|
|
$table->date('start_date')->nullable();
|
|
$table->date('end_date')->nullable();
|
|
$table->date('origin_start_date')->nullable();
|
|
$table->bigInteger('website_id')->nullable();
|
|
$table->string('travel_number', 80)->nullable();
|
|
$table->string('participant_name', 255)->nullable();
|
|
$table->string('participant_firstname', 255)->nullable();
|
|
$table->date('participant_birthdate')->nullable();
|
|
$table->bigInteger('participant_salutation_id')->nullable();
|
|
$table->tinyInteger('participant_pass')->nullable()->default(0);
|
|
$table->unsignedInteger('nationality_id')->nullable();
|
|
$table->string('ev_number', 255)->nullable();
|
|
$table->string('merlin_knr', 255)->nullable();
|
|
$table->string('merlin_order_number', 255)->nullable();
|
|
$table->bigInteger('travel_company_id')->nullable();
|
|
$table->tinyInteger('travel_documents')->nullable()->default(0);
|
|
$table->decimal('canceled', 5, 2)->nullable()->default(0.00);
|
|
$table->decimal('price', 10, 2)->nullable();
|
|
$table->decimal('price_canceled', 10, 2)->nullable();
|
|
$table->decimal('price_total', 10, 2)->nullable();
|
|
$table->decimal('price_balance', 10, 2)->nullable();
|
|
$table->decimal('deposit_total', 10, 2)->nullable();
|
|
$table->decimal('final_payment', 10, 2)->nullable();
|
|
$table->date('final_payment_date')->nullable();
|
|
$table->bigInteger('travelagenda_id')->nullable();
|
|
$table->tinyInteger('paying_out')->nullable()->default(0);
|
|
$table->tinyInteger('paying_out_status')->nullable()->default(0);
|
|
$table->unsignedBigInteger('airline_id')->nullable();
|
|
$table->string('airline_ids', 255)->nullable();
|
|
$table->tinyInteger('refund')->nullable()->default(0);
|
|
$table->date('refund_date')->nullable();
|
|
$table->date('lawyer_date')->nullable();
|
|
$table->tinyInteger('hold')->nullable()->default(0);
|
|
$table->tinyInteger('xx_tkt')->nullable()->default(0);
|
|
$table->date('xx_tkt_date')->nullable();
|
|
$table->string('filekey', 255)->nullable();
|
|
$table->tinyInteger('is_rail_fly')->nullable()->default(0);
|
|
$table->text('notice')->nullable();
|
|
|
|
$table->dateTime('updated_at');
|
|
$table->dateTime('created_at');
|
|
|
|
$table->index('lead_id', 'lead_id_idx');
|
|
$table->index('sf_guard_user_id', 'sf_guard_user_id_idx');
|
|
$table->index('branch_id', 'branch_id_idx');
|
|
$table->index('customer_id', 'customer_id_idx');
|
|
$table->index('coupon_id', 'coupon_id_idx');
|
|
$table->index('travel_category_id', 'travel_category_id_idx');
|
|
$table->index('travel_country_id', 'travel_country_id_idx');
|
|
$table->index('travel_company_id', 'booking_travel_company_id_idx');
|
|
$table->index('travelagenda_id', 'booking_travelagenda_id_idx');
|
|
|
|
$table->foreign('branch_id', 'booking_branch_id_branch_id')->references('id')->on('branch')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('coupon_id', 'booking_coupon_id_coupon_id')->references('id')->on('coupon')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('customer_id', 'booking_customer_id_customer_id')->references('id')->on('customer')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('lead_id', 'booking_lead_id_lead_id')->references('id')->on('lead')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('sf_guard_user_id', 'booking_sf_guard_user_id_sf_guard_user_id')->references('id')->on('sf_guard_user')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('travel_category_id', 'booking_travel_category_id_travel_category_id')->references('id')->on('travel_category')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('travel_company_id', 'booking_travel_company_id_travel_company_id')->references('id')->on('travel_company')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('travel_country_id', 'booking_travel_country_id_travel_country_id')->references('id')->on('travel_country')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('travelagenda_id', 'booking_travelagenda_id_travel_agenda_id')->references('id')->on('travel_agenda')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
$table->foreign('airline_id', 'booking_airline_id_airline_id')->references('id')->on('airline')->onDelete('RESTRICT
|
|
')->onUpdate('RESTRICT');
|
|
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('booking');
|
|
}
|
|
}
|