# 可以恢复访问记录吗？

**URL:** <https://meta.discourse.org/t/can-i-restore-visit-streaks/238731>\
**Category:** Product Support\
**Created:** [2022 年9 月 12 日 04:02 UTC](https://meta.discourse.org/t/can-i-restore-visit-streaks/238731 "2022-09-12T04:02:30Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

作者： ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)\
发布日期： [2023 年1 月 1 日 22:44 UTC](https://meta.discourse.org/t/can-i-restore-visit-streaks/238731/7 "2023-01-01T22:44:02Z")

</div>

嘿，我们又发生了一次中断，当我再次尝试恢复访问记录时，出现了一个错误。

```plaintext
[6] pry(main)> DB.exec("insert into user_visits select 4, user_id, '2022-12-31', posts_read, mobile, 0 from user_visits where visited_at = '2022-09-01'")
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "user_visits_pkey"
DETAIL: Key (id)=(4) already exists.

from /var/www/discourse/vendor/bundle/ruby/3.1.0/gems/rack-mini-profiler-3.0.0/lib/patches/db/pg.rb:110:in `exec'

```

---

_[View the full topic](https://meta.discourse.org/t/can-i-restore-visit-streaks/238731)._
