From 2f8925f01e0cd5862f3f36648f7d3570cbd46674 Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Tue, 10 Sep 2024 10:51:56 +0800 Subject: [PATCH] fix: migration for db without pgvector --- migrations/20240904000000_af_collab_embeddings_indices.sql | 1 - migrations/20240910100000_af_collab_embeddings_indices.sql | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 migrations/20240904000000_af_collab_embeddings_indices.sql create mode 100644 migrations/20240910100000_af_collab_embeddings_indices.sql diff --git a/migrations/20240904000000_af_collab_embeddings_indices.sql b/migrations/20240904000000_af_collab_embeddings_indices.sql deleted file mode 100644 index 338e6c99..00000000 --- a/migrations/20240904000000_af_collab_embeddings_indices.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX af_collab_embeddings_oid_idx ON public.af_collab_embeddings (oid); diff --git a/migrations/20240910100000_af_collab_embeddings_indices.sql b/migrations/20240910100000_af_collab_embeddings_indices.sql new file mode 100644 index 00000000..a96761d4 --- /dev/null +++ b/migrations/20240910100000_af_collab_embeddings_indices.sql @@ -0,0 +1,6 @@ +DO $$ +BEGIN + CREATE INDEX IF NOT EXISTS af_collab_embeddings_oid_idx ON public.af_collab_embeddings (oid); +EXCEPTION WHEN others THEN + RAISE NOTICE 'could not create index on af_collab_embeddings(oid), ignoring this migration'; +END $$;