created write database ruby script