<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddCardDateToStudentCardSettings extends Migration
{
    public function up()
    {
        $this->forge->addColumn('student_card_settings', [
            'card_date' => [
                'type'    => 'DATE',
                'null'    => true,
                'default' => null,
                'after'   => 'show_qrcode',
            ],
            'motto' => [
                'type'       => 'VARCHAR',
                'constraint' => 200,
                'null'       => true,
                'default'    => null,
                'after'      => 'card_date',
            ],
        ]);
    }

    public function down()
    {
        $this->forge->dropColumn('student_card_settings', ['card_date', 'motto']);
    }
}