fixed deploy hook for creating and filling db

concerns #639