更新时间:2023-02-03 18:21:02
删除旧索引,并使用新约束再次添加它:
Remove the old index and add it again with the new constraint:
def change remove_index :editabilities, [:user_id, :list_id] add_index :editabilities, [:user_id, :list_id], unique: true end
如何通过迁移向现有索引添加`unique`约束