# NULL first\_visited\_at dates in the topic\_users table

**URL:** <https://meta.discourse.org/t/null-first-visited-at-dates-in-the-topic-users-table/45996>\
**Category:** Development\
**Created:** [18. Juni 2016 um 09:17 UTC](https://meta.discourse.org/t/null-first-visited-at-dates-in-the-topic-users-table/45996 "2016-06-18T09:17:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [19. Juni 2016 um 04:48 UTC](https://meta.discourse.org/t/null-first-visited-at-dates-in-the-topic-users-table/45996/3 "2016-06-19T04:48:22Z")

</div>

> [@DeanMarkTaylor](#):
>
> nowhere in Discourse code base where this was an actual “problem”

Not that I can see. I was thinking about [quote=“Mittineague, post:1, topic:45996”]  
total\_msecs\_viewed  
[/quote]

But when I checked earlier not a single row had Null or the default 0  
The oddest were 5000 msec from the eviltrout seed posts. But they are seed posts so that isn’t too alarming.

Most of my coding experience is JavaScript, PHP and MySQL  
Many other languages and databases too, but not to any great extent.

I was wondering if there might be something with Ruby time ↔ Postgres time,  
But from what I’ve found online it seems they should play well together.

I’ve also noticed

```plaintext
TopicUser.create(attrs.merge!(user_id: user_id, topic_id: topic_id, first_visited_at: now ,last_visited_at: now))

```

and thought that maybe merge was discarding any second identical value.

But I have rows where both first\_visited\_at and last\_visited\_at had the same value, so unless it happens during a certain path I don’t think that’s it either.

---

_[View the full topic](https://meta.discourse.org/t/null-first-visited-at-dates-in-the-topic-users-table/45996)._
