c3lf-system-3/database/migrations/2019_11_28_035156_create_files_table.php

38 lines
742 B
PHP
Raw Normal View History

2019-11-28 03:52:53 +00:00
<?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');
}
}