mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-13 11:56:20 +00:00
Fix db migration
This commit is contained in:
@@ -88,25 +88,15 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userVersion < 4) {
|
if (userVersion < 4) {
|
||||||
db.all('SELECT preferences FROM users', (err, rows) => {
|
db.run('UPDATE users SET preferences = ? WHERE preferences = ?',
|
||||||
if (err) {
|
['{"accentColor":{"alpha":1,"hex":"#607D8B","hexa":"#607D8BFF","hsla":{"h":200,"s":18,"l":46,"a":1},"hsva":{"h":200,"s":31,"v":55,"a":1},"hue":200,"rgba":{"r":96,"g":125,"b":139,"a":1}}}', '{}'],
|
||||||
logger.error(err)
|
(err) => {
|
||||||
} else {
|
if (err) {
|
||||||
rows.forEach(row => {
|
logger.error(err)
|
||||||
if (row.preferences === '{}') {
|
} else {
|
||||||
db.run('UPDATE users SET preferences = ?',
|
db.run('PRAGMA user_version = 4')
|
||||||
['{"accentColor":{"alpha":1,"hex":"#607D8B","hexa":"#607D8BFF","hsla":{"h":200,"s":18,"l":46,"a":1},"hsva":{"h":200,"s":31,"v":55,"a":1},"hue":200,"rgba":{"r":96,"g":125,"b":139,"a":1}}}'],
|
}
|
||||||
(err) => {
|
})
|
||||||
if (err) {
|
|
||||||
logger.error(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
db.run('PRAGMA user_version = 4')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user