add and update to the schema
add some sql clean up