From 9f165338cbe6ab5e416e38a529a350412f11adc9 Mon Sep 17 00:00:00 2001 From: Ben Eggers <64657842+beggers@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:18:35 -0700 Subject: [PATCH] [BUG] Wipe sysdb and reapply schema each time (#1898) ## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Correctly wipe the sysdb and re-apply schema each push. ## Test plan *How are these changes tested?* - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes *Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?* --- go/migrations/20240313233558.sql | 2 ++ go/migrations/atlas.sum | 4 ++-- k8s/distributed-chroma/templates/sysdb-migration.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go/migrations/20240313233558.sql b/go/migrations/20240313233558.sql index e8d72ab372a..d86bcf072c2 100644 --- a/go/migrations/20240313233558.sql +++ b/go/migrations/20240313233558.sql @@ -1,3 +1,5 @@ +CREATE SCHEMA "public"; + -- Create "collection_metadata" table CREATE TABLE "public"."collection_metadata" ( "collection_id" text NOT NULL, diff --git a/go/migrations/atlas.sum b/go/migrations/atlas.sum index df6b20e0eee..04e4dfc5644 100644 --- a/go/migrations/atlas.sum +++ b/go/migrations/atlas.sum @@ -1,2 +1,2 @@ -h1:Q+UeSEuBZon9dDhW0jtrv4UYIX0CkFd+WYE9xRH7hoM= -20240313233558.sql h1:WqdAFn0qL9z9fAItKv7kQuENhDpawT0FRsIrWDhLoJ0= +h1:Dp024rtdoEin0+duRRzaVGXblk6B0WSa0X3H/m4SRh8= +20240313233558.sql h1:shyeY6BuLGJ1Ia/G/hH+NZS6HZqHxhBJ2Pfdoeerz7I= diff --git a/k8s/distributed-chroma/templates/sysdb-migration.yaml b/k8s/distributed-chroma/templates/sysdb-migration.yaml index 009a2a2948e..611d38a8d31 100644 --- a/k8s/distributed-chroma/templates/sysdb-migration.yaml +++ b/k8s/distributed-chroma/templates/sysdb-migration.yaml @@ -14,7 +14,7 @@ spec: - command: - "/bin/sh" - "-c" - - "atlas schema clean && atlas migrate apply --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}" + - "atlas schema clean --auto-approve --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}; atlas migrate apply --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}" image: "{{ .Values.sysdbMigration.image.repository }}:{{ .Values.sysdbMigration.image.tag }}" imagePullPolicy: IfNotPresent name: migration