2019-11-15 20:57:07 +00:00
|
|
|
<?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');
|
2019-11-28 03:52:53 +00:00
|
|
|
$table->unsignedBigInteger('item_uid');
|
2019-11-15 20:57:07 +00:00
|
|
|
$table->string('bezeichnung');
|
2019-11-28 03:52:53 +00:00
|
|
|
$table->timestamp('wann');
|
2019-11-15 20:57:07 +00:00
|
|
|
$table->string('wo');
|
|
|
|
$table->unsignedBigInteger('eid');
|
|
|
|
$table->unsignedBigInteger('cid');
|
|
|
|
$table->timestamps();
|
2019-11-28 03:52:53 +00:00
|
|
|
$table->softDeletes();
|
|
|
|
|
|
|
|
$table->unique(['eid', 'item_uid']);
|
2019-11-15 20:57:07 +00:00
|
|
|
|
|
|
|
$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');
|
|
|
|
}
|
|
|
|
}
|