UPDATE article_files SET file_type = 'application/pdf' WHERE original_file_name RLIKE '\\.pdf$' UPDATE article_files SET file_type = 'application/msword' WHERE original_file_name RLIKE '\\.doc$' UPDATE article_files SET file_type = 'application/vnd.ms-powerpoint' WHERE original_file_name RLIKE '\\.ppt$' UPDATE article_files SET file_type = 'application/vnd.ms-powerpoint' WHERE original_file_name RLIKE '\\.pps$' UPDATE article_files SET file_type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' WHERE original_file_name RLIKE '\\.docx$' UPDATE article_files SET file_type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' WHERE original_file_name RLIKE '\\.pptx$' UPDATE article_files SET file_type = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' WHERE original_file_name RLIKE '\\.ppsx$' UPDATE article_files SET file_type = 'application/pdf' WHERE original_file_name ~* '.pdf$' UPDATE article_files SET file_type = 'application/msword' WHERE original_file_name ~* '.doc$' UPDATE article_files SET file_type = 'application/vnd.ms-powerpoint' WHERE original_file_name ~* '.ppt$' UPDATE article_files SET file_type = 'application/vnd.ms-powerpoint' WHERE original_file_name ~* '.pps$' UPDATE article_files SET file_type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' WHERE original_file_name ~* '.docx$' UPDATE article_files SET file_type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' WHERE original_file_name ~* '.pptx$' UPDATE article_files SET file_type = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' WHERE original_file_name ~* '.ppsx$'