17 nov 2018
This commit is contained in:
parent
0c9a118281
commit
765d6a2f6b
52 changed files with 3200 additions and 229 deletions
|
|
@ -16,6 +16,7 @@ class CreateDraftTypesTable extends Migration
|
|||
Schema::create('draft_types', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('color', 10)->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
|
|
|
|||
|
|
@ -16,20 +16,17 @@ class CreateDraftItemsTable extends Migration
|
|||
Schema::create('draft_items', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('draft_id')->index();
|
||||
$table->unsignedInteger('draft_type_id')->index();
|
||||
$table->unsignedInteger('draft_type_id')->nullable()->index();
|
||||
|
||||
$table->tinyInteger('days_start')->unsigned()->nullable();
|
||||
$table->tinyInteger('days_duration')->unsigned()->nullable();
|
||||
|
||||
$table->string('name')->nullable();
|
||||
$table->text('service')->nullable();
|
||||
$table->decimal('price_adult', 8, 2)->nullable();
|
||||
$table->tinyInteger('adult')->unsigned()->nullable();
|
||||
$table->decimal('price_children', 8, 2)->nullable();
|
||||
$table->tinyInteger('children')->unsigned()->nullable();
|
||||
|
||||
|
||||
$table->text('content')->nullable();
|
||||
|
||||
$table->tinyInteger('pos')->unsigned()->nullable();
|
||||
$table->boolean('in_pdf')->default(true);
|
||||
$table->boolean('active')->default(true);
|
||||
|
|
@ -56,3 +53,6 @@ class CreateDraftItemsTable extends Migration
|
|||
Schema::dropIfExists('draft_items');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateBookingDraftItemsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('booking_draft_items', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
|
||||
$table->bigInteger('booking_id')->index();
|
||||
$table->integer('travel_program_id')->index();
|
||||
$table->integer('travel_class_id')->nullable()->index();
|
||||
|
||||
|
||||
$table->unsignedInteger('draft_item_id')->nullable()->index();
|
||||
$table->integer('draft_type_id')->nullable()->index();
|
||||
|
||||
$table->date('request_date')->nullable();
|
||||
|
||||
$table->tinyInteger('days_start')->unsigned()->nullable();
|
||||
$table->tinyInteger('days_duration')->unsigned()->nullable();
|
||||
|
||||
$table->date('start_date')->nullable();
|
||||
$table->date('end_date')->nullable();
|
||||
|
||||
$table->text('service')->nullable();
|
||||
$table->decimal('price_adult', 8, 2)->nullable();
|
||||
$table->tinyInteger('adult')->unsigned()->nullable();
|
||||
$table->decimal('price_children', 8, 2)->nullable();
|
||||
$table->tinyInteger('children')->unsigned()->nullable();
|
||||
|
||||
$table->tinyInteger('pos')->unsigned()->nullable();
|
||||
$table->boolean('in_pdf')->default(true);
|
||||
$table->boolean('status')->default(false);
|
||||
|
||||
$table->boolean('comfort')->default(false);
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('booking_id')
|
||||
->references('id')
|
||||
->on('booking');
|
||||
|
||||
$table->foreign('draft_item_id')
|
||||
->references('id')
|
||||
->on('draft_items');
|
||||
|
||||
$table->foreign('draft_type_id')
|
||||
->references('id')
|
||||
->on('draft_types');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('booking_draft_items');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTravelCountryTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('mysql_stern')->create('travel_country', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
|
||||
$table->integer('id')->index();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('html_information')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql_stern')->dropIfExists('travel_country');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTravelProgramCountryTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('mysql_stern')->create('travel_program_country', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
|
||||
$table->integer('program_id')->nullable()->index();
|
||||
$table->integer('country_id')->nullable()->index();
|
||||
|
||||
$table->foreign('program_id')
|
||||
->references('id')
|
||||
->on('travel_program');
|
||||
|
||||
$table->foreign('country_id')
|
||||
->references('id')
|
||||
->on('travel_country');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('mysql_stern')->dropIfExists('travel_program_country');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
<?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();
|
||||
$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->dateTime('created_at');
|
||||
$table->dateTime('updated_at');
|
||||
$table->string('title', 255)->nullable();
|
||||
$table->date('start_date')->nullable();
|
||||
$table->date('end_date')->nullable();
|
||||
$table->bigInteger('website_id')->nullable();
|
||||
$table->string('travel_number', 30)->nullable();
|
||||
$table->string('participant_name', 80)->nullable();
|
||||
$table->string('participant_firstname', 80)->nullable();
|
||||
$table->date('participant_birthdate')->nullable();
|
||||
$table->bigInteger('participant_salutation_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->decimal('price', 10, 2)->nullable();
|
||||
$table->decimal('price_total', 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->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');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('booking');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue