const pool = require('./database');
const today = new Date().toLocaleDateString('en-CA');

async function fix() {
  try {
    await pool.query('UPDATE production_logs SET log_date = $1', [today]);
    await pool.query('UPDATE production_attendance SET log_date = $1', [today]);
    console.log('Successfully updated all production logs and attendance records to today:', today);
  } catch (err) {
    console.error('Error updating dates:', err);
  } finally {
    await pool.end();
  }
}

fix();
