Create the UUID index on the right table as well as on table creation

This is what happens when you copy & paste while staring at a file for too long...