fix: small mistake in migration script

This commit is contained in:
alikia2x (寒寒) 2024-12-09 00:34:12 +08:00
parent 1f9b8ea124
commit 04cf5a8ab8
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
2 changed files with 2 additions and 2 deletions

View File

@ -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",

View File

@ -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};`);
}
}