More work on the SQL schema.