<?php
require_once __DIR__ . '/../includes/db.php';

try {
    echo "Checking column in 'companies' table...\n";
    // Check if column exists
    $cols = fetchAll("SHOW COLUMNS FROM companies LIKE 'working_hours'");
    if (!empty($cols)) {
        echo "Column 'working_hours' exists. Dropping it...\n";
        query("ALTER TABLE companies DROP COLUMN working_hours");
        echo "Successfully dropped 'working_hours' column from 'companies' table.\n";
    } else {
        echo "Column 'working_hours' does not exist in 'companies' table.\n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
