add update_storage_stats procedure

This commit is contained in:
Isaac Connor 2018-01-26 13:08:10 -05:00
parent bb9d640c01
commit 2d9f9125aa
1 changed files with 17 additions and 1 deletions

View File

@ -273,10 +273,26 @@ CREATE TABLE `Events_Archived` (
) ENGINE=@ZM_MYSQL_ENGINE@; ) ENGINE=@ZM_MYSQL_ENGINE@;
drop trigger if exists event_update_trigger; drop procedure if exists update_storage_stats;
delimiter // delimiter //
create procedure update_storage_stats(IN StorageId smallint(5), IN space BIGINT)
sql security invoker
deterministic
begin
update Storage set DiskSpace = DiskSpace + space where Id = StorageId;
end;
//
drop trigger if exists event_update_trigger//
CREATE TRIGGER event_update_trigger AFTER UPDATE ON Events CREATE TRIGGER event_update_trigger AFTER UPDATE ON Events
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN