add file model
This commit is contained in:
parent
53037d26af
commit
acf701da70
10 changed files with 96 additions and 9 deletions
|
@ -14,10 +14,18 @@ class CreateEventsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::create('events', function (Blueprint $table) {
|
||||
$table->charset = 'utf8';
|
||||
$table->collation = 'utf8_unicode_ci';
|
||||
$table->bigIncrements('eid');
|
||||
$table->string('name');
|
||||
$table->string('short_name');
|
||||
$table->string('slug');
|
||||
$table->timestamps();
|
||||
$table->timestamp('start')->nullable();
|
||||
$table->timestamp('end')->nullable();
|
||||
$table->timestamp('pre_start')->nullable();
|
||||
$table->timestamp('post_end')->nullable();
|
||||
|
||||
$table->unique('slug','uslug');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ class CreateContainersTable extends Migration
|
|||
{
|
||||
Schema::create('containers', function (Blueprint $table) {
|
||||
$table->bigIncrements('cid');
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -15,12 +15,16 @@ class CreateItemsTable extends Migration
|
|||
{
|
||||
Schema::create('items', function (Blueprint $table) {
|
||||
$table->bigIncrements('iid');
|
||||
$table->unsignedBigInteger('item_uid');
|
||||
$table->string('bezeichnung');
|
||||
$table->string('wann');
|
||||
$table->timestamp('wann');
|
||||
$table->string('wo');
|
||||
$table->unsignedBigInteger('eid');
|
||||
$table->unsignedBigInteger('cid');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unique(['eid', 'item_uid']);
|
||||
|
||||
$table->foreign('eid')->references('eid')->on('events');
|
||||
$table->foreign('cid')->references('cid')->on('containers');
|
||||
|
|
37
database/migrations/2019_11_28_035156_create_files_table.php
Normal file
37
database/migrations/2019_11_28_035156_create_files_table.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFilesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('files', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unsignedBigInteger('iid');
|
||||
$table->string('hash');
|
||||
|
||||
|
||||
$table->foreign('iid')->references('iid')->on('items');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('file');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue