Refactor SQL files for V2
Add SQL upgrade script from V1 to V2