Remove and backup orphaned notes records
#438239 (closed) introduced a non-null constraint to prevent notes records with null noteable_type.
The orphaned notes records with noteable_type=NULL should be removed then the non-null constraint should be validated.
To locate and delete the orphaned records (there are few records), an index should've been added.
To be safe, create a table (use CREATE TABLE (LIKE notes ...)) and copy over the orphaned records before deleting them.
Edited by euko