add updated at on put primary key

This commit is contained in:
mpostma 2021-03-12 14:43:17 +01:00
parent 615fe095e1
commit f0210453a6
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A

View File

@ -142,6 +142,7 @@ impl Index {
/// Writes the documents primary key, this is the field name that is used to store the id. /// Writes the documents primary key, this is the field name that is used to store the id.
pub fn put_primary_key(&self, wtxn: &mut RwTxn, primary_key: &str) -> heed::Result<()> { pub fn put_primary_key(&self, wtxn: &mut RwTxn, primary_key: &str) -> heed::Result<()> {
self.set_updated_at(wtxn, &Utc::now())?;
self.main.put::<_, Str, Str>(wtxn, PRIMARY_KEY_KEY, &primary_key) self.main.put::<_, Str, Str>(wtxn, PRIMARY_KEY_KEY, &primary_key)
} }