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

try {
    // Add company_id column to machinery table
    query("ALTER TABLE machinery ADD COLUMN company_id INT AFTER is_active");
    
    // Set a default company_id if possible (e.g. from session if running manually, or just 1)
    // For now, let's just add the column.
    
    echo "Column company_id added successfully.\n";
} catch (Exception $e) {
    echo "Error adding column: " . $e->getMessage() . "\n";
}
