<?php
namespace Core\Database\Operations;

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

class RenameTable implements MigrationOperation
{
    protected string $oldName;
    protected string $newName;

    public function __construct(string $oldName, string $newName)
    {
        $this->oldName = $oldName;
        $this->newName = $newName;
    }

    public function up()
    {
        Schema::renameTable($this->oldName, $this->newName);
    }

    public function down()
    {
        Schema::renameTable($this->newName, $this->oldName);
    }
}
