create table events ( ID int ); create table handled_events ( last_handled_id int, handler text );