update sql structure and add doc