Make sure the very first line in that migration file is a comment, like this:
# frozen_string_literal: true
This is a special kind of thing known as a “magic comment”.