kuvia/database/migrations/2021_01_11_221353_image.php

41 lines
1,013 B
PHP
Raw Normal View History

2021-01-12 14:49:45 +00:00
<?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");
}
}