Skip to content

Commit

Permalink
add pgvector extension fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 23, 2024
1 parent b522531 commit 057d633
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions supabase/migrations/20240223051710_remote_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ CREATE SCHEMA IF NOT EXISTS "public";

ALTER SCHEMA "public" OWNER TO "pg_database_owner";

DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_extension
WHERE extname = 'vector'
) THEN
CREATE EXTENSION vector
SCHEMA extensions;
END IF;
END $$;

CREATE OR REPLACE FUNCTION "public"."check_similarity_and_insert"("query_table_name" "text", "query_user_id" "uuid", "query_user_ids" "uuid"[], "query_content" "jsonb", "query_room_id" "uuid", "query_embedding" "extensions"."vector", "similarity_threshold" double precision) RETURNS "void"
LANGUAGE "plpgsql"
AS $$
Expand Down

0 comments on commit 057d633

Please sign in to comment.