You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: migrations.rb
    path of file: ./repos/spree/core/lib/spree
    
    the code of the file until where you have to start completion: module Spree
  class Migrations
    attr_reader :config, :engine_name

    # Takes the engine config block and engine name
    def initialize(config, engine_name)
      @config = config
      @engine_name = engine_name
    end

    # Puts warning when any engine migration is not present on the Rails app
    # db/migrate dir
    #
    # First split:
    #
    #   ["20131128203548", "update_name_fields_on_spree_credit_cards.spree.rb"]
    #
    # Sec
    
    def engine_migrations
      Dir.entries(engine_dir).map do |file_name|
        name = file_name.split('_', 2).last.split('.', 2).first
        name.empty? ? next : name
      end.compact! || []
    end

    def app_migrations
      Dir.entries(app_dir).map do |file_name|
        next if ['.', '..'].include? file_name

        name = file_name.split('_', 2).last
        name.empty? ? next : name
      end.compact! || []
    end

    def app_dir
      "#{Rails.root}/db/migrate"
    end

    def engine_dir
      "#{config.root}/db/migrate"
    end

    def match_engine?(engine)
      if engine_name == 'spree'
        # Avoid stores upgrading from 1.3 getting wrong warnings
        ['spree.rb', 'spree_promo.rb'].include? engine
      else
        engine == "#{engine_name}.rb"
      end
    end
  end