updated sql prepare env script