PATH:
home
/
lab2454c
/
costbloc.com
/
Modules
/
Blog
/
Database
/
Migrations
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateBlogsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('blogs', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('category_id')->nullable(); $table->bigInteger('user_id')->nullable(); $table->string('title', 191); $table->string('slug', 191); $table->string('summary', 191); $table->mediumText('description'); $table->string('status', 8)->default('Active'); $table->integer('total_views')->default(0); $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable(); $table->foreign('user_id')->references('id')->on('users') ->onDelete('set null') ->onUpdate('set null'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('blogs'); } }
[+]
..
[-] 2023_01_05_023932_blog_trigger.php
[edit]
[-] 2021_12_15_064237_create_blog_categories_table.php
[edit]
[-] 2021_12_15_064237_create_blogs_table.php
[edit]