oops, that last commit was bad
Updated sql script. Tristan, try this script out and tell me if it works