I see this error with the app, reported by NextJS, please fix it. The er
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ import Database from 'better-sqlite3';
|
|||||||
const db = new Database('local.db');
|
const db = new Database('local.db');
|
||||||
|
|
||||||
function seed() {
|
function seed() {
|
||||||
console.log('Seeding database...');
|
console.log('Seeding database with settings and email templates...');
|
||||||
|
|
||||||
// Create settings table if it doesn't exist
|
// Create settings table if it doesn't exist
|
||||||
db.exec(`
|
db.exec(`
|
||||||
|
|||||||
+2
-2
@@ -99,10 +99,10 @@ const userStmt = db.prepare('SELECT id FROM users WHERE email = ?');
|
|||||||
const defaultUser = userStmt.get('admin@example.com');
|
const defaultUser = userStmt.get('admin@example.com');
|
||||||
if (!defaultUser) {
|
if (!defaultUser) {
|
||||||
const insertUser = db.prepare(
|
const insertUser = db.prepare(
|
||||||
"INSERT INTO users (id, email, password, name) VALUES (?, ?, ?, ?)"
|
"INSERT INTO users (id, email, password, name, emailVerified) VALUES (?, ?, ?, ?, ?)"
|
||||||
);
|
);
|
||||||
// Note: In a real app, hash the password!
|
// Note: In a real app, hash the password!
|
||||||
insertUser.run('cl-admin-user-id', 'admin@example.com', 'password', 'Admin User');
|
insertUser.run('cl-admin-user-id', 'admin@example.com', 'password', 'Admin User', Date.now());
|
||||||
console.log('Default user created.');
|
console.log('Default user created.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user