postgres is a stickler for types

This commit is contained in:
Andre Medeiros 2022-03-26 12:54:51 -04:00
parent 88a3e0a21f
commit 188036a838

View file

@ -92,7 +92,7 @@ func (p *postgresDeviceRepository) GetInboxNotifiableByAccountID(ctx context.Con
INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id
WHERE devices_accounts.account_id = $1 AND WHERE devices_accounts.account_id = $1 AND
devices_accounts.inbox_notifiable = TRUE AND devices_accounts.inbox_notifiable = TRUE AND
grace_period_until > NOW()` grace_period_until > EXTRACT(EPOCH FROM NOW())`
return p.fetch(ctx, query, id) 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 INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id
WHERE devices_accounts.account_id = $1 AND WHERE devices_accounts.account_id = $1 AND
devices_accounts.watcher_notifiable = TRUE AND devices_accounts.watcher_notifiable = TRUE AND
grace_period_until > NOW()` grace_period_until > EXTRACT(EPOCH FROM NOW())`
return p.fetch(ctx, query, id) return p.fetch(ctx, query, id)
} }