ALTER TABLE notification_rule
    ADD COLUMN name VARCHAR(64) NOT NULL DEFAULT '' AFTER id;

UPDATE notification_rule SET name = CONCAT('rule-', id) WHERE name = '';

ALTER TABLE notification_rule
    ADD UNIQUE KEY uk_name (name);
