Any reason we're doing this with SQL rather than ActiveRecord?