<?php

namespace Signteer\Core\Database;

use Plainwork\Database\Database;

class VolunteerTable
{
    public const NAME = '__volunteer';
    public const COL_ID = 'id';
    public const COL_TITLE = 'title';
    public const COL_EMAIL = 'email';
    public const COL_PHONE = 'phone';

    public function up1($db)
    {
        $cols = [
            self::COL_ID => ['type' => 'INTEGER', 'null' => false, 'autoIncrement' => true, 'primaryKey' => true],
            self::COL_TITLE => ['type' => 'VARCHAR(255)', 'null' => false],
            self::COL_EMAIL => ['type' => 'VARCHAR(255)', 'null' => false],
            self::COL_PHONE => ['type' => 'VARCHAR(255)', 'null' => false],
        ];
        $db->createTable(self::NAME, $cols);
    }

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