Prepared sql upgrade script