const sqlite3 = require('sqlite3').verbose();
const path = require('path');

const dbPath = path.join(__dirname, 'inventory.db');
const db = new sqlite3.Database(dbPath);

db.serialize(() => {
    // Add status column to users table
    db.run("ALTER TABLE users ADD COLUMN status TEXT DEFAULT 'Active'", (err) => {
        if (err) {
            if (err.message.includes('duplicate column name')) {
                console.log('Column status already exists');
            } else {
                console.error('Error adding status column:', err);
            }
        } else {
            console.log('Successfully added status column to users table');
        }
    });
});

db.close();
