<?php
namespace Core\Database\Operations;

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

class DropColumn implements MigrationOperation
{
    protected string $table;
    protected string $column;

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

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

    public function down()
    {
        throw new \Exception("Cannot rollback DropColumn: no column info for column '{$this->column}'.");
    }
}
