import { pool } from "./config/db.js";

async function migrate() {
  try {
    await pool.query("ALTER TABLE payments MODIFY COLUMN method VARCHAR(50) NOT NULL DEFAULT 'cash'");
    console.log("Migration complete: payments.method modified to VARCHAR(50)");
    process.exit(0);
  } catch (err) {
    console.error("Migration failed:", err);
    process.exit(1);
  }
}

migrate();
