forked from getzep/zep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix/migrate broken embedding columns (getzep#256)
* move migrations to after table creation * actually commit migrations
- Loading branch information
1 parent
da58ee1
commit 5dc5082
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
pkg/store/postgres/migrations/2023110100_add_missing_embedding_column.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
*/ | ||
|
29 changes: 29 additions & 0 deletions
29
pkg/store/postgres/migrations/2023110100_add_missing_embedding_column.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
$$; | ||
|