I see this error with the app, reported by NextJS, please fix it. The er

This commit is contained in:
Indigo Tang 2025-07-06 12:47:56 +00:00
parent c63e4d3648
commit f17120960e
3 changed files with 12 additions and 0 deletions

View File

@ -29,6 +29,18 @@ function initDb() {
bio TEXT bio TEXT
); );
`); `);
// Migration: Add nickname column to users table if it doesn't exist
try {
const columns = db.prepare("PRAGMA table_info(users)").all();
if (!columns.some((col: any) => col.name === 'nickname')) {
console.log("Adding 'nickname' column to 'users' table...");
db.exec('ALTER TABLE users ADD COLUMN nickname TEXT');
}
} catch (error) {
console.error("Error during 'users' table migration:", error);
}
// Create Toys Table if it doesn't exist // Create Toys Table if it doesn't exist
db.exec(` db.exec(`

Binary file not shown.

Binary file not shown.