<?php

namespace Tenant\Database\Migrations;

use CodeIgniter\Database\Migration;

/**
 * A short manager-entered blurb shown under the rate plan's name on the
 * Rate Plans list (e.g. "Peak season premium rates for holidays and
 * festivities.") — purely descriptive, no effect on how the plan is
 * resolved/applied (see RatePlanModel::resolveRate()).
 */
class AddDescriptionToRatePlans extends Migration
{
    public function up()
    {
        $this->forge->addColumn('rate_plans', [
            'description' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => true,
                'after'      => 'name',
            ],
        ]);
    }

    public function down()
    {
        $this->forge->dropColumn('rate_plans', 'description');
    }
}
