Update to Sql scripts for upgrade112

Fixed problems on some scripts for the DB upgrade to v.1.1.2.