fix: small mistake in migration script
This commit is contained in:
parent
1f9b8ea124
commit
04cf5a8ab8
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openrewind",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"type": "module",
|
||||
"description": "Your second brain, superpowered.",
|
||||
"main": "dist/electron/index.js",
|
||||
|
@ -110,7 +110,7 @@ function transformSegments(db: Database) {
|
||||
|
||||
function renameColumn(tableName: string, oldColumnName: string, newColumnName: string, db: Database) {
|
||||
if (db.prepare(`SELECT 1 FROM pragma_table_info(?) WHERE name=?`).get([tableName, oldColumnName])) {
|
||||
db.prepare(`ALTER TABLE ? RENAME COLUMN ? TO ?`).run([tableName, oldColumnName, newColumnName]);
|
||||
db.exec(`ALTER TABLE ${tableName} RENAME COLUMN ${oldColumnName} TO ${newColumnName};`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user