db setup and patch script