<?php
require_once 'includes/db.php';
try {
    $pdo->exec("ALTER TABLE line_stages ADD COLUMN quantity INT DEFAULT 0 AFTER end_date");
    echo "Column 'quantity' added to line_stages successfully.\n";
} catch (PDOException $e) {
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo "Column 'quantity' already exists.\n";
    } else {
        echo "Error: " . $e->getMessage() . "\n";
    }
}
?>
