44 lines
1 KiB
PHP
44 lines
1 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class StorageLog extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create("storage", function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->timestamps();
|
||
|
$table->smallInteger("year");
|
||
|
$table->tinyInteger("month");
|
||
|
$table->tinyInteger("day");
|
||
|
$table->tinyInteger("hour");
|
||
|
$table->date("date");
|
||
|
$table->unsignedBigInteger("tenant");
|
||
|
$table->unsignedBigInteger("gallery");
|
||
|
$table->bigInteger("size");
|
||
|
|
||
|
$table->foreign('gallery')->references('id')->on('galleries');
|
||
|
$table->foreign('tenant')->references('id')->on('tenants');
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists("storage");
|
||
|
}
|
||
|
}
|