From 78c5345541a49881f85ea1b4f82429fef070c29c Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 2 Jul 2023 16:20:11 -0700 Subject: silly deadlock bug, sql typos --- src/dbctx.rs | 3 +-- src/sql.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/dbctx.rs b/src/dbctx.rs index 0b1b7ad..049a490 100644 --- a/src/dbctx.rs +++ b/src/dbctx.rs @@ -615,8 +615,7 @@ impl DbCtx { ) .expect("can insert"); - self.conn.lock() - .unwrap() + conn .query_row( "select id from hosts where \ ( \ diff --git a/src/sql.rs b/src/sql.rs index 1ed9205..9f0d7aa 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -118,7 +118,7 @@ pub const CREATE_RUNS_TABLE: &'static str = "\ pub const CREATE_HOSTS_TABLE: &'static str = "\ CREATE TABLE IF NOT EXISTS hosts (id INTEGER PRIMARY KEY AUTOINCREMENT, hostname TEXT, - cpu_vendor TEXT, + cpu_vendor_id TEXT, cpu_model_name TEXT, cpu_family TEXT, cpu_model TEXT, @@ -128,7 +128,7 @@ pub const CREATE_HOSTS_TABLE: &'static str = "\ arch TEXT, family TEXT, os TEXT, - UNIQUE(hostname, cpu_vendor, cpu_model_name, cpu_family, cpu_model, cpu_microcode, cpu_cores, mem_total, arch, family, os));"; + UNIQUE(hostname, cpu_vendor_id, cpu_model_name, cpu_family, cpu_model, cpu_microcode, cpu_cores, mem_total, arch, family, os));"; pub const CREATE_REMOTES_INDEX: &'static str = "\ CREATE INDEX IF NOT EXISTS 'repo_to_remote' ON remotes(repo_id);"; -- cgit v1.1