Ruby on rails 在rails中以唯一和并发方式运行迁移

Ruby on rails 在rails中以唯一和并发方式运行迁移,ruby-on-rails,activerecord,Ruby On Rails,Activerecord,只想确认一下,这就是您将如何标记迁移以同时运行唯一约束(active record 4+) 参考下面的链接,您可能会对此有所了解 disable_ddl_transaction! def change add_index :strings, [:word, :user_id], unique: true, algorithm: :concurrently end

只想确认一下,这就是您将如何标记迁移以同时运行唯一约束(active record 4+)


参考下面的链接,您可能会对此有所了解

disable_ddl_transaction!

def change 
  add_index :strings, [:word, :user_id], unique: true, algorithm: :concurrently
end