Rewritten the db init script