fix a few things
add missing index

It wasn't in schema.sql but we have it on the production DB.