mein-sterntours/database/migrations/2020_01_29_152709_create_participant_table.php
2021-11-09 18:38:44 +01:00

56 lines
1.8 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 CreateParticipantTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('participant', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('booking_id')->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_child')->nullable()->default(0);
$table->tinyInteger('participant_pass')->nullable()->default(0);
$table->tinyInteger('participant_storno')->nullable()->default(0);
$table->unsignedInteger('nationality_id')->nullable();
$table->index('booking_id', 'participant_booking_id_idx');
$table->index('participant_salutation_id', 'participant_participant_salutation_id_idx');
$table->foreign('booking_id', 'participant_booking_id_booking_id')->references('id')->on('booking')->onDelete('CASCADE
')->onUpdate('RESTRICT');
$table->foreign('participant_salutation_id', 'participant_participant_salutation_id_salutation_id')->references('id')->on('salutation')->onDelete('RESTRICT
')->onUpdate('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('participant');
}
}