<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddPenulisToBerita extends Migration
{
    public function up()
    {
        $this->forge->addColumn('berita', [
            'penulis' => [
                'type'       => 'VARCHAR',
                'constraint' => 100,
                'null'       => true,
                'after'      => 'gambar', // kalau kolom gambar ada
            ],
        ]);
    }

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