 
 create table if not exists purchase_item_history (
     id integer references purchase_item(id) on delete restrict,
-    change bigint references change(id) on delete restrict,
+    change bigint references change(id) on delete cascade,
     primary key(id, change),
     -- valid can be set to false at any time.
     valid bool not null default true,


create table if not exists account_history (
    id integer references account(id) on delete restrict,
    change bigint references change(id) on delete restrict,
    primary key(id, change),
    -- valid can only be false if no other valid item references the account id.
    valid bool not null default true,


create table if not exists item_usage_history (
    id integer references item_usage(id) on delete restrict,
    change bigint references change(id) on delete cascade,
    primary key(id, change),
    -- valid can be set to false at any time.
    valid bool not null default true,
