You can try to use UPDATE let typeALTER column set thea default value.
then ALTER column be not null.
UPDATE T SET type = '' WHERE type IS NULL; ALTER TABLE `T` MODIFY `type` varchar(50) NOTDEFAULT NULL;'default'; then insert by DEFAULT keyword:
INSERT INTO T (type) VALUES (DEFAULT);