Comparison

plugins/mod_storage_sql.lua @ 12631:9524bb7f3944

mod_storage_sql: Drop archive timestamp precision pending schema update The "when" column is an INTEGER which will probably be unhappy about storing higher precision timestamps, so we keep the older behavior for now.
author Kim Alvefur <zash@zash.se>
date Sun, 14 Aug 2022 17:29:39 +0200
parent 12600:3d3a0c4e2662
child 12723:4cfd09343947
comparison
equal deleted inserted replaced
12630:781772c8b6d9 12631:9524bb7f3944
319 if item_count >= archive_item_limit then 319 if item_count >= archive_item_limit then
320 return nil, "quota-limit"; 320 return nil, "quota-limit";
321 end 321 end
322 end 322 end
323 323
324 when = when or os.time(); 324 -- FIXME update the schema to allow precision timestamps
325 when = when and math.floor(when) or os.time();
325 with = with or ""; 326 with = with or "";
326 local ok, ret = engine:transaction(function() 327 local ok, ret = engine:transaction(function()
327 local delete_sql = [[ 328 local delete_sql = [[
328 DELETE FROM "prosodyarchive" 329 DELETE FROM "prosodyarchive"
329 WHERE "host"=? AND "user"=? AND "store"=? AND "key"=?; 330 WHERE "host"=? AND "user"=? AND "store"=? AND "key"=?;