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 Gallery extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('galleries', function (Blueprint $table) {
|
|
|
|
$table->id();
|
|
|
|
$table->timestamps();
|
|
|
|
$table->string('name');
|
|
|
|
$table->string('url');
|
|
|
|
$table->mediumText("description")->nullable();
|
|
|
|
$table->unsignedBigInteger("tenant");
|
2021-01-12 16:50:08 +00:00
|
|
|
$table->date("gallery_create_time")->default(\Illuminate\Support\Facades\DB::raw('(CURRENT_DATE)'));
|
2021-01-12 14:49:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
$table->foreign('tenant')->references('id')->on('tenants');
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists("galleries");
|
|
|
|
}
|
|
|
|
}
|