SQL schema messed up regarding location log