2022_11_30_105135_create_beritas_table.php 1.04 KB
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBeritasTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('beritas', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->foreignId('kategori_berita_id')->nullable()->constrained();
            $table->text('judul')->nullable();
            $table->mediumText('konten')->nullable();
            $table->date('tanggal')->nullable();
            $table->json('gambar')->nullable();
            $table->boolean('slide_show')->default(false);
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
            $table->timestamp('deleted_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('beritas');
    }
}