<?php
require_once __DIR__ . '/config.php';

$db = db();

try {
    // 1. Remove foreign key column from cities
    $db->exec("ALTER TABLE cities DROP COLUMN settlement_size_id;");
    echo "Removed settlement_size_id from cities table.\n";

    // 2. Drop settlement_sizes table
    $db->exec("DROP TABLE IF EXISTS settlement_sizes;");
    echo "Dropped settlement_sizes table.\n";

    echo "Migration completed successfully.\n";
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage() . "\n";
}

