fix object deletion, identity attr insertion
parent
e462801823
commit
dc05b05873
|
@ -234,7 +234,8 @@ pub fn remove_object<C: Connection<Backend = Sqlite>>(
|
|||
debug!("Deleting {}!", object_address);
|
||||
|
||||
let matches = data
|
||||
.filter(target.eq(object_address.encode()?))
|
||||
.filter(identity.eq(object_address.encode()?))
|
||||
.or_filter(target.eq(object_address.encode()?))
|
||||
.or_filter(value.eq(EntryValue::Address(object_address).to_string()?));
|
||||
|
||||
Ok(diesel::delete(matches).execute(connection)?)
|
||||
|
@ -567,7 +568,7 @@ pub fn insert_entry<C: Connection<Backend = Sqlite>>(
|
|||
debug!("Inserting: {}", entry);
|
||||
|
||||
let insert_entry = models::Entry {
|
||||
identity: entry.hash()?.0,
|
||||
identity: entry.address()?.encode()?,
|
||||
target: entry.target.encode()?,
|
||||
key: entry.key,
|
||||
value: entry.value.to_string()?,
|
||||
|
|
Loading…
Reference in New Issue