Fixing the db generation script