관리-도구
편집 파일: 2023_03_06_164042_create_blogs_table.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateBlogsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('blogs', function (Blueprint $table) { $table->id(); $table->text('is_featured')->nullable(); $table->text('title')->nullable(); $table->text('sub_title')->nullable(); $table->text('content')->nullable(); $table->text('image')->nullable(); $table->string('button_text')->nullable(); $table->string('button_link')->nullable(); $table->tinyInteger('is_active')->default(1); $table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); $table->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP')); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('blogs'); } }