Travel Group / Programms

This commit is contained in:
Kevin Adametz 2021-08-20 18:21:38 +02:00
parent 9baa1a6233
commit a718baf971
23 changed files with 808 additions and 89 deletions

View file

@ -0,0 +1,59 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateIQTravelProgramsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql_stern')->create('i_q_travel_programs', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->nullable();
$table->string('code')->nullable();
$table->unsignedTinyInteger('typ')->nullable();
$table->integer('travel_country_id')->nullable();
$table->text('description')->nullable();
$table->text('highlights')->nullable();
$table->text('not_included')->nullable();
$table->string('weekdays')->nullable();
$table->tinyInteger('days_duration')->unsigned()->nullable();
$table->decimal('discount', 5, 2)->nullable();
$table->decimal('deposit_pro', 5, 2)->nullable();
$table->decimal('price_adult_total', 10, 2)->nullable();
$table->decimal('price_children_total', 10, 2)->nullable();
$table->string('travel_insurance')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->foreign('travel_country_id')
->references('id')
->on('travel_country');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('mysql_stern')->dropIfExists('i_q_travel_programs');
}
}

View file

@ -0,0 +1,55 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateIQTravelProgramItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::connection('mysql_stern')->create('i_q_travel_program_items', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('i_q_travel_program_id')->index();
$table->unsignedInteger('i_q_travel_item_id')->nullable()->index();
$table->unsignedInteger('i_q_travel_group_id')->nullable()->index();
$table->unsignedTinyInteger('typ')->nullable();
$table->unsignedTinyInteger('pos')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->foreign('i_q_travel_program_id')
->references('id')
->on('i_q_travel_programs')
->onDelete('cascade');
$table->foreign('i_q_travel_item_id')
->references('id')
->on('i_q_travel_items')
->onDelete('cascade');
$table->foreign('i_q_travel_group_id')
->references('id')
->on('i_q_travel_groups')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::connection('mysql_stern')->dropIfExists('i_q_travel_program_items');
}
}