40 lines
940 B
PHP
40 lines
940 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class CreateItemsTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('items', function (Blueprint $table) {
|
||
|
$table->bigIncrements('iid');
|
||
|
$table->string('bezeichnung');
|
||
|
$table->string('wann');
|
||
|
$table->string('wo');
|
||
|
$table->unsignedBigInteger('eid');
|
||
|
$table->unsignedBigInteger('cid');
|
||
|
$table->timestamps();
|
||
|
|
||
|
$table->foreign('eid')->references('eid')->on('events');
|
||
|
$table->foreign('cid')->references('cid')->on('containers');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('items');
|
||
|
}
|
||
|
}
|