fix script for generate database