Skip to content

Commit

Permalink
Change how the timestamp is generated
Browse files Browse the repository at this point in the history
  • Loading branch information
CollectiveUnicorn committed Aug 28, 2024
1 parent 68a29c2 commit 50fc526
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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';
Expand Down

0 comments on commit 50fc526

Please sign in to comment.