<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddIsPublishedToBerita extends Migration
{
    public function up()
    {
        $this->forge->addColumn('berita', [
            'is_published' => [
                'type'       => 'TINYINT',
                'constraint' => 1,
                'default'    => 1,
                'after'      => 'penulis', // kalau penulis ada
            ],
        ]);
    }

    public function down()
    {
        $this->forge->dropColumn('berita', 'is_published');
    }
}
