fixed db upgrade script