<?php
namespace Core\Database\Operations;

use Core\Database\Schema;
use Core\Database\MigrationOperation;

class AddColumn implements MigrationOperation
{
    protected string $table;
    protected string $column;
    protected string $type;

    public function __construct(string $table, string $column, string $type)
    {
        $this->table = $table;
        $this->column = $column;
        $this->type = $type;
    }

    public function up()
    {
        Schema::addColumn($this->table, $this->column, $this->type);
    }

    public function down()
    {
        Schema::dropColumn($this->table, $this->column);
    }
}
