<?php

namespace Signteer\Core\Database;

use Plainwork\Database\Database;

class SettingTable
{
    public $db = Database::class;
    public const NAME = '__setting';
    public const COL_NAME = 'setting_name';
    public const COL_VALUE = 'setting_value';

    public function up1($db)
    {
        $cols = [
            'setting_name' => ['type' => 'VARCHAR(255)', 'null' => false, 'primaryKey' => true],
            'setting_value' => ['type' => 'TEXT', 'null' => false, 'default' => ''],
        ];
        $db->createTable(self::NAME, $cols);
    }

    public function down1($db)
    {
        $db->dropTable(self::NAME);
    }
}
