From 50fc526999684a2c14df86b6364c4eed6aa75c4f Mon Sep 17 00:00:00 2001 From: gharvey Date: Wed, 28 Aug 2024 11:57:46 -0700 Subject: [PATCH] Change how the timestamp is generated --- .../migrations/20240827103100_v0.11.1_indexing_status.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/api/supabase/migrations/20240827103100_v0.11.1_indexing_status.sql b/packages/api/supabase/migrations/20240827103100_v0.11.1_indexing_status.sql index 4716aec18..d5daf9231 100644 --- a/packages/api/supabase/migrations/20240827103100_v0.11.1_indexing_status.sql +++ b/packages/api/supabase/migrations/20240827103100_v0.11.1_indexing_status.sql @@ -1,5 +1,5 @@ -- Update the vector_store_file table to add an updated_at column -ALTER TABLE vector_store_file ADD COLUMN updated_at timestamp(3) DEFAULT CURRENT_TIMESTAMP NOT NULL; +ALTER TABLE vector_store_file ADD COLUMN updated_at timestamp DEFAULT timezone('utc', now()) NOT NULL; -- Add an index on user_id for faster queries CREATE INDEX idx_vector_store_file_user_id ON vector_store_file(user_id); @@ -8,7 +8,7 @@ CREATE INDEX idx_vector_store_file_user_id ON vector_store_file(user_id); CREATE OR REPLACE FUNCTION update_modified_column() RETURNS TRIGGER AS $$ BEGIN - NEW.updated_at = CURRENT_TIMESTAMP; + NEW.updated_at = timezone('utc', now()); RETURN NEW; END; $$ language 'plpgsql';