标签: ruby-on-rails activerecord
只需确认一下,这是您如何标记迁移以同时运行唯一约束(活动记录4 +)
disable_ddl_transaction! def change add_index :strings, [:word, :user_id], unique: true, algorithm: :concurrently end
答案 0 :(得分:0)
请参考以下链接,您可能会对此有所了解https://robots.thoughtbot.com/how-to-create-postgres-indexes-concurrently-in