I see this error with the app, reported by NextJS, please fix it. The er
This commit is contained in:
parent
c63e4d3648
commit
f17120960e
|
|
@ -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(`
|
||||||
|
|
|
||||||
BIN
toyshare.db-shm
BIN
toyshare.db-shm
Binary file not shown.
BIN
toyshare.db-wal
BIN
toyshare.db-wal
Binary file not shown.
Loading…
Reference in New Issue