41 行
1.1 KiB
PHP
41 行
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateHomePagesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('home_pages', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->unsignedBigInteger('user_id');
|
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
|
$table->string('title', 255);
|
|
$table->string('slug', 255);
|
|
$table->integer('sortorder', 10)->default(0);
|
|
$table->dateTime('published_at')->nullable();
|
|
$table->integer('public_status')->default(0); // 0 = public, 1 = scheduled, 2 = unlisted, 3 = private, 4 = draft
|
|
$table->boolean('is_menu')->default(true);
|
|
$table->text('message');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('home_pages');
|
|
}
|
|
}
|