Corrections in upgrade script regarding NOT NULL constraints