Update SQL definitions, and make login etc actually use the DB