Default for missing aindex column

This commit is contained in:
Hanh 2022-04-11 22:50:11 +08:00
parent a2b63ca25a
commit fef886205b
1 changed files with 2 additions and 0 deletions

View File

@ -823,6 +823,8 @@ impl DbAdapter {
}
pub fn get_full_backup(&self) -> anyhow::Result<Vec<AccountBackup>> {
let _ = self.connection.execute("ALTER TABLE accounts ADD COLUMN aindex INT NOT NULL DEFAULT 0", NO_PARAMS); // ignore error
let mut statement = self.connection.prepare(
"SELECT name, seed, aindex, a.sk AS z_sk, ivk, a.address AS z_addr, t.sk as t_sk, t.address AS t_addr FROM accounts a LEFT JOIN taddrs t ON a.id_account = t.account")?;
let rows = statement.query_map(NO_PARAMS, |r| {