• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lucyparsons / OpenOversight / 5646666141
89%

Build:
DEFAULT BRANCH: develop
Ran 24 Jul 2023 03:24PM UTC
Jobs 1
Files 84
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Jul 2023 03:17PM UTC coverage: 90.425% (-0.5%) from 90.877%
5646666141

push

github

web-flow
Change `timestamp` datatypes to `timestamptz` (#978)

## Fixes issue
https://github.com/lucyparsons/OpenOversight/issues/323

## Description of Changes
Standardizing column names and changing `timestamp` datatypes to
`timestamptz`. To make sure the times were presented accurately, I
created a function that was called before any other ones to set the
`TIMEZONE` in the session object. From there, I used a filter that
applies the user's timezone to any dates that are presented. This
session object goes away after `60` minutes of no requests, though that
value is configurable should someone to change it.

The solution is essentially based off these two solutions:
- https://stackoverflow.com/a/75271114
- https://stackoverflow.com/a/49891626

Column name changes:
- `descriptions`: `date_created` -> `created_at`, `date_updated` ->
`updated_at`
- `notes`: `date_created` -> `created_at`, `date_updated` ->
`updated_at`
- `raw_images`: `date_image_inserted`: `created_at`, `date_image_taken`:
`taken_at`

As a `timestamp`:
<img width="1097" alt="Screenshot 2023-07-19 at 1 45 05 PM"
src="https://github.com/lucyparsons/OpenOversight/assets/5885605/34ead7a9-e2de-43b7-a414-b50b7f0de0cb">

As a `timestamptz`:
<img width="1095" alt="Screenshot 2023-07-19 at 1 52 46 PM"
src="https://github.com/lucyparsons/OpenOversight/assets/5885605/d6a34acb-aa98-43d7-929a-9d80dc01416c">

As a `timestamp` (testing the `downgrade` command):
<img width="1093" alt="Screenshot 2023-07-19 at 1 53 06 PM"
src="https://github.com/lucyparsons/OpenOversight/assets/5885605/26c06464-1816-4ca2-8c6d-f5091f79dc9c">

## Screenshots
Description and Note `created_at` confirmation:
<img width="524" alt="Screenshot 2023-07-20 at 5 46 46 PM"
src="https://github.com/lucyparsons/OpenOversight/assets/5885605/486e3690-2509-42db-89f2-990a89ea222c">

`descriptions.updated_at`: `2023-07-19 19:08:54.587185 +00:00` -> `July
19, 2023 2:08 PM`
`notes.updated_at`: `2023-07-19 ... (continued)

7196 of 7958 relevant lines covered (90.42%)

0.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5646666141.1 24 Jul 2023 03:24PM UTC 0
90.42
GitHub Action Run
Source Files on build 5646666141
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #5646666141
  • 273adb2a on github
  • Prev Build on develop (#5601103633)
  • Next Build on develop (#5647161189)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc