Files
lelong/database/migrations/2022_01_13_064027_create_file_table.php
T
2022-01-16 16:26:38 +08:00

41 lines
969 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFileTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('file', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->unsigned();
$table->string('file_type');
$table->string('filename');
$table->datetime('deleted_at')->nullable();
$table->integer('deleted_by')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
}