From 188036a838dab13afd718d7aabe035aea0067e2a Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sat, 26 Mar 2022 12:54:51 -0400 Subject: [PATCH] postgres is a stickler for types --- internal/repository/postgres_device.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/repository/postgres_device.go b/internal/repository/postgres_device.go index c146471..a6e6249 100644 --- a/internal/repository/postgres_device.go +++ b/internal/repository/postgres_device.go @@ -92,7 +92,7 @@ func (p *postgresDeviceRepository) GetInboxNotifiableByAccountID(ctx context.Con INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id WHERE devices_accounts.account_id = $1 AND devices_accounts.inbox_notifiable = TRUE AND - grace_period_until > NOW()` + grace_period_until > EXTRACT(EPOCH FROM NOW())` return p.fetch(ctx, query, id) } @@ -104,7 +104,7 @@ func (p *postgresDeviceRepository) GetWatcherNotifiableByAccountID(ctx context.C INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id WHERE devices_accounts.account_id = $1 AND devices_accounts.watcher_notifiable = TRUE AND - grace_period_until > NOW()` + grace_period_until > EXTRACT(EPOCH FROM NOW())` return p.fetch(ctx, query, id) }