Fix database setup, test encryption and repositories - all working
Co-authored-by: southseact-3d <217551146+southseact-3d@users.noreply.github.com>
This commit is contained in:
@@ -67,18 +67,11 @@ async function setupDatabase() {
|
||||
|
||||
const db = getDatabase();
|
||||
|
||||
// Split by semicolon and execute each statement
|
||||
const statements = schema
|
||||
.split(';')
|
||||
.map(s => s.trim())
|
||||
.filter(s => s.length > 0 && !s.startsWith('--'));
|
||||
|
||||
for (const statement of statements) {
|
||||
db.exec(statement);
|
||||
}
|
||||
// Execute the entire schema as one block
|
||||
// SQLite can handle multiple statements with exec()
|
||||
db.exec(schema);
|
||||
|
||||
console.log('✅ Database schema created');
|
||||
console.log(` Executed ${statements.length} SQL statements`);
|
||||
} catch (error) {
|
||||
console.error('❌ Failed to create schema:', error.message);
|
||||
closeDatabase();
|
||||
|
||||
Reference in New Issue
Block a user