import { db } from '../src/database/connection';
import { sql } from 'drizzle-orm';
import * as fs from 'fs';
import * as path from 'path';

async function resetDatabase() {
  try {
    console.log('🔥 Resetting database...');
    
    const migrationSQL = fs.readFileSync(
      path.join(__dirname, '../drizzle/0002_fresh_start.sql'),
      'utf-8'
    );

    // Execute the migration
    await db.execute(sql.raw(migrationSQL));
    
    console.log('✅ Database reset successfully!');
    process.exit(0);
  } catch (error) {
    console.error('❌ Error resetting database:', error);
    process.exit(1);
  }
}

resetDatabase();

