<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class Menu extends Migration
{
    public function up()
    {
        //
        $this->forge->addField([
            'id_menu'        => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
            'libelle'        => ['type' => 'VARCHAR', 'constraint' => 150],
            'created_at'     => ['type' => 'DATETIME', 'null' => true],
            'updated_at'     => ['type' => 'DATETIME', 'null' => true],
            'deleted_at'     => ['type' => 'DATETIME', 'null' => true],
        ]);
        
        $this->forge->addKey('id_menu', true); // Primary key
        $this->forge->createTable('sys_menu');
    }

    public function down()
    {
        //
        $this->forge->dropTable('sys_menu');
    }
}
