<?php

use Phalcon\Mvc\Model\Migration;
class LogEmailMigration_439 extends Migration {
    public function up() {
        self::$connection->execute("ALTER TABLE jaga.log_email ADD COLUMN IF NOT EXISTS error_message text;");

        self::$connection->execute("
            INSERT INTO jaga.app_config(kode, nilai, keterangan) VALUES ('LIMIT_MAIL_BACKGROUND', 10, 'Jumlah email yang dikirim dalam 1 batch melalui scheduled task');
        ");
    }

    public function down() {
        self::$connection->execute("ALTER TABLE jaga.log_email DROP COLUMN IF EXISTS error_message;");
        self::$connection->execute("DELETE FROM jaga.app_config WHERE kode = 'LIMIT_MAIL_BACKGROUND';");
    }
}
