Skip to content

Commit

Permalink
fix/migrate broken embedding columns (getzep#256)
Browse files Browse the repository at this point in the history
* move migrations to after table creation

* actually commit migrations
  • Loading branch information
danielchalef authored Nov 1, 2023
1 parent da58ee1 commit 5dc5082
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Intentionally left blank as we don't want to remove an
embedding column that was potentially already there before the up
*/

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
DO $$
BEGIN
IF EXISTS(
SELECT
FROM
pg_tables
WHERE
tablename = 'message_embedding') THEN
ALTER TABLE message_embedding
ADD COLUMN IF NOT EXISTS embedding vector(1536);
END IF;
END
$$;


DO $$
BEGIN
IF EXISTS(
SELECT
FROM
pg_tables
WHERE
tablename = 'summary_embedding') THEN
ALTER TABLE summary_embedding
ADD COLUMN IF NOT EXISTS embedding vector(1536);
END IF;
END
$$;

0 comments on commit 5dc5082

Please sign in to comment.