继续讨论 SSO 损坏 - 找不到请求的 URL 或资源:
我遇到了类似的问题:
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "idx_tag_users_ix1"
有什么办法可以删除重复的键吗?
继续讨论 SSO 损坏 - 找不到请求的 URL 或资源:
我遇到了类似的问题:
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "idx_tag_users_ix1"
有什么办法可以删除重复的键吗?
我认为这是因为您有大小写混合的标签(您有 tag 和 Tag)。
这是在重建时发生的还是在其他时间发生的?
我认为应该做的是尝试重建索引,然后修复标签的大小写(如果我猜得没错),或者删除其中一个重复的条目。
嗯…… 事实并非如此。
Tag.all.pluck(:name)
=> ["welcome",
"faq",
"sysadmin",
"offdem-0x03",
"reference",
"tutorial",
"local-organization",
"collective-data",
"power-relations",
"offdem-topic",
"offdem-0x00",
"offdem-0x01",
"offdem-0x02",
"discourse-plugin",
"page",
"how-to",
"about",
"offdem-0x04"]
据推测,它出现在本月早些时候。我想是在升级之后。
我不知道它是怎么发生的,但我可以删除重复的标签:
TagUser.all.where(user_id: 80, tag_id:2).last.destroy
对于每一个重复项(我是手动完成的)。
谢谢你,Jay!
这些重复的 whatever 问题通常都是这样。
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.