<?php
require __DIR__ . '/../config/database.php';
try {
    $pdo->exec("CREATE TABLE IF NOT EXISTS maintenance_jobs_backup AS SELECT * FROM maintenance_jobs WHERE workflow_stage = 'Maintenance Review'");
    $count = $pdo->exec("UPDATE maintenance_jobs SET workflow_stage = 'Work Order Raised' WHERE workflow_stage = 'Maintenance Review'");
    echo "Updated: $count\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
    exit(1);
}
