const db = require('./config/database');

async function checkSchema() {
  try {
    console.log('Checking subscriptions table schema...');
    const [subColumns] = await db.execute('DESCRIBE device_subscriptions');
    console.log('\ndevice_subscriptions columns:');
    subColumns.forEach(col => console.log(`  - ${col.Field} (${col.Type})`));

    console.log('\n\nChecking payment_transactions table schema...');
    const [txnColumns] = await db.execute('DESCRIBE payment_transactions');
    console.log('\npayment_transactions columns:');
    txnColumns.forEach(col => console.log(`  - ${col.Field} (${col.Type})`));

    process.exit(0);
  } catch (error) {
    console.error('Error:', error.message);
    process.exit(1);
  }
}

checkSchema();
