Fix various cases where db/structure.sql either didn't match the production db or didn't match the db structure produced when running migrations from a fresh install.
Fix various cases where db/structure.sql either didn't match the production db or didn't match the db structure produced when running migrations from a fresh install.