fix upgrade issue with not null, varchar(max)