Update API to handle the multiple formats of datetime Postgres might use.

This commit is contained in:
2019-05-18 12:18:35 -05:00
parent 4c60c30b7d
commit 5026e3963c
4 changed files with 22 additions and 7 deletions

View File

@ -14,8 +14,8 @@ create table "api_tokens" (
id uuid default uuid_generate_v4() primary key,
user_id uuid not null references users (id) on delete cascade on update cascade,
name varchar not null,
created timestamp with time zone not null default current_timestamp,
expires timestamp with time zone default null,
created timestamp(0) with time zone not null default current_timestamp,
expires timestamp(0) with time zone default null,
hashed_token varchar not null
);
@ -33,7 +33,7 @@ create table "measurements" (
id uuid default uuid_generate_v4() primary key,
measure_id uuid not null references measures (id) on delete cascade on update cascade,
value integer not null,
"timestamp" timestamp with time zone not null default current_timestamp,
"timestamp" timestamp(0) with time zone not null default current_timestamp,
ext_data jsonb not null default '{}'::json
);
@ -44,7 +44,7 @@ create table client_log_entries (
"scope" varchar not null,
message varchar not null,
stacktrace varchar not null,
"timestamp" timestamp with time zone not null default current_timestamp
"timestamp" timestamp(0) with time zone not null default current_timestamp
);
create index client_log_entries_by_level on client_log_entries ("level");