kuvia/database/migrations/2021_01_11_221353_image.php

41 lines
1013 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class Image extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('images', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->string("path");
$table->string("driver");
$table->string("filename");
$table->integer("size");
$table->timestamp("uploaded_at")->default(\Illuminate\Support\Facades\DB::raw('CURRENT_TIMESTAMP'));
$table->timestamp("deleted_at")->nullable();
$table->unsignedBigInteger("gallery");
$table->foreign('gallery')->references('id')->on('galleries');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists("images");
}
}