refactor(sql): recreate keypairs table

Removed unused `addr` and `created` field.
`is_default` boolean flag is moved into `config` row
pointing to the current default key.
This commit is contained in:
link2xt
2023-11-30 19:24:31 +00:00
parent 58620988d7
commit 55cdbdc085
5 changed files with 73 additions and 55 deletions

View File

@@ -670,7 +670,7 @@ async fn export_self_keys(context: &Context, dir: &Path) -> Result<()> {
let keys = context
.sql
.query_map(
"SELECT id, public_key, private_key, is_default FROM keypairs;",
"SELECT id, public_key, private_key, id=(SELECT value FROM config WHERE keyname='key_id') FROM keypairs;",
(),
|row| {
let id = row.get(0)?;