reincorporate trigger
This commit is contained in:
@@ -24,3 +24,11 @@ create table if not exists games (
|
|||||||
create index if not exists nonposted_games
|
create index if not exists nonposted_games
|
||||||
on games(posted)
|
on games(posted)
|
||||||
where posted = 0;
|
where posted = 0;
|
||||||
|
|
||||||
|
create trigger if not exists delete_old_states
|
||||||
|
before insert on games
|
||||||
|
begin
|
||||||
|
delete from games
|
||||||
|
where json ->> 'gamePk' = new.json ->> 'gamePk' and
|
||||||
|
json ->> 'status' ->> 'detailedState' != new.json ->> 'status' ->> 'detailedState';
|
||||||
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user