<?php

require_once '../../vendor/autoload.php';
require_once '../../cors/index.php';

switch ($_SERVER['REQUEST_METHOD']) {
    case 'POST':
        atualizar();
        break;
    
    default:
        # code...
        break;
}

function atualizar() {
    try {
        $migrationController = new \src\Controller\migrationController();
        $migrationController->up();

        http_response_code(200);
    } catch (Exception $e) {
        echo json_encode(['error' => $e->getMessage()]);
        http_response_code(500);
    }

}