refact schema sql