diff --git a/.gitignore b/.gitignore index 2dccac6..a73e11a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ Homestead.json Homestead.yaml .env /public/docs -/resources/docs \ No newline at end of file +/resources/docs + +composer.lock +composer.phar diff --git a/app/Container.php b/app/Container.php index c075725..5745d2c 100644 --- a/app/Container.php +++ b/app/Container.php @@ -13,7 +13,7 @@ class Container extends Model * @var array */ protected $fillable = [ - 'cid' + 'cid', 'name' ]; /** @@ -22,4 +22,4 @@ class Container extends Model * @var array */ protected $hidden = []; -} \ No newline at end of file +} diff --git a/app/Event.php b/app/Event.php index c249f79..9369a8c 100644 --- a/app/Event.php +++ b/app/Event.php @@ -13,7 +13,7 @@ class Event extends Model * @var array */ protected $fillable = [ - 'eid', 'name', 'short_name' + 'eid', 'name', 'slug', 'begin', 'end', 'pre_begin', 'post_end' ]; /** @@ -22,4 +22,4 @@ class Event extends Model * @var array */ protected $hidden = []; -} \ No newline at end of file +} diff --git a/app/File.php b/app/File.php new file mode 100644 index 0000000..1fdca8e --- /dev/null +++ b/app/File.php @@ -0,0 +1,25 @@ +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'); }); } diff --git a/database/migrations/2019_11_14_214212_create_containers_table.php b/database/migrations/2019_11_14_214212_create_containers_table.php index e77c946..2ee7e5a 100644 --- a/database/migrations/2019_11_14_214212_create_containers_table.php +++ b/database/migrations/2019_11_14_214212_create_containers_table.php @@ -15,6 +15,7 @@ class CreateContainersTable extends Migration { Schema::create('containers', function (Blueprint $table) { $table->bigIncrements('cid'); + $table->string('name'); $table->timestamps(); }); } diff --git a/database/migrations/2019_11_14_232911_create_items_table.php b/database/migrations/2019_11_14_232911_create_items_table.php index d017f2d..164ecd1 100644 --- a/database/migrations/2019_11_14_232911_create_items_table.php +++ b/database/migrations/2019_11_14_232911_create_items_table.php @@ -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'); diff --git a/database/migrations/2019_11_28_035156_create_files_table.php b/database/migrations/2019_11_28_035156_create_files_table.php new file mode 100644 index 0000000..e5da094 --- /dev/null +++ b/database/migrations/2019_11_28_035156_create_files_table.php @@ -0,0 +1,37 @@ +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'); + } +}