updated generate database sql script