add update_storage_stats procedure
This commit is contained in:
parent
bb9d640c01
commit
2d9f9125aa
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue