对于 rails,使用手写迁移创建 'ar_internal_metadata' table 是个好主意吗?

For rails, is creating the 'ar_internal_metadata' table with a handwritten migration a good idea?

当我 运行 迁移时,'ar_internal_metadata' table 一直从架构中剥离。

  create_table 'ar_internal_metadata', primary_key: 'key', force: :cascade do |t|
    t.datetime 'created_at', null: false
    t.datetime 'updated_at', null: false
    t.string 'value'
  end

如果我通过手动迁移创建 'ar_internal_metadata',它会正常工作还是会出现问题?

keeps being stripped out of the schema.

这是expected behaviour:

  # activerecord/lib/active_record/schema_dumper.rb
  def ignored?(table_name)
    [ActiveRecord::Base.schema_migrations_table_name, ActiveRecord::Base.internal_metadata_table_name, ignore_tables].flatten.any? do |ignored|
      ignored === remove_prefix_and_suffix(table_name)
    end
  end