I see this error with the app, reported by NextJS, please fix it. The er
This commit is contained in:
@@ -23,19 +23,6 @@ function seed() {
|
|||||||
)
|
)
|
||||||
`);
|
`);
|
||||||
|
|
||||||
// Create flows table
|
|
||||||
db.exec(`
|
|
||||||
CREATE TABLE IF NOT EXISTS flows (
|
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
||||||
name TEXT NOT NULL,
|
|
||||||
description TEXT,
|
|
||||||
path TEXT NOT NULL,
|
|
||||||
createdAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
updatedAt DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
||||||
)
|
|
||||||
`);
|
|
||||||
|
|
||||||
|
|
||||||
// Check if the hourly_rate setting already exists
|
// Check if the hourly_rate setting already exists
|
||||||
const settingStmt = db.prepare('SELECT * FROM settings WHERE key = ?');
|
const settingStmt = db.prepare('SELECT * FROM settings WHERE key = ?');
|
||||||
const hourlyRateSetting = settingStmt.get('hourly_rate');
|
const hourlyRateSetting = settingStmt.get('hourly_rate');
|
||||||
@@ -111,21 +98,6 @@ function seed() {
|
|||||||
console.log('Default email template updated.');
|
console.log('Default email template updated.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seed default flow
|
|
||||||
const flowStmt = db.prepare('SELECT * FROM flows WHERE id = ?');
|
|
||||||
const defaultFlow = flowStmt.get(1);
|
|
||||||
|
|
||||||
if (!defaultFlow) {
|
|
||||||
const insertFlow = db.prepare(
|
|
||||||
"INSERT INTO flows (id, name, description, path) VALUES (?, ?, ?, ?)"
|
|
||||||
);
|
|
||||||
insertFlow.run(1, 'Cost Estimator', 'The main cost estimation tool for clients.', '/');
|
|
||||||
console.log('Default flow created.');
|
|
||||||
} else {
|
|
||||||
console.log('Default flow already exists.');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
console.log('Seeding complete.');
|
console.log('Seeding complete.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user