build db script