From 082feeb847bda003f5b6937186854e2c305fdd7a Mon Sep 17 00:00:00 2001 From: projectmoon Date: Wed, 10 Apr 2024 00:03:44 +0200 Subject: [PATCH] identity column --- supabase/migrations/20240409190001_bus_funcs.sql | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/supabase/migrations/20240409190001_bus_funcs.sql b/supabase/migrations/20240409190001_bus_funcs.sql index 1b56f7e..73a4d38 100644 --- a/supabase/migrations/20240409190001_bus_funcs.sql +++ b/supabase/migrations/20240409190001_bus_funcs.sql @@ -6,10 +6,11 @@ CREATE EXTENSION IF NOT EXISTS "pg_net" SCHEMA extensions; -- request ID is inserted by first cron job, -- then second cron job updates from net._http_response table. create table if not exists raw_bus_positions ( - request_id int not null, - created timestamp with time zone not null default now(), - response_status int null, - response_json jsonb null + id BIGINT GENERATED ALWAYS AS IDENTITY, + request_id INT not null, + created TIMESTAMP WITH TIME ZONE not null default now(), + response_status INT null, + response_json JSONB null ); -- used to help craft the API URL. Requires plv8 extension.