Skip to content

Commit

Permalink
[BUG] Wipe sysdb and reapply schema each time (#1898)
Browse files Browse the repository at this point in the history
## 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)?*
  • Loading branch information
beggers authored Mar 20, 2024
1 parent c07281f commit 9f16533
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions go/migrations/20240313233558.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CREATE SCHEMA "public";

-- Create "collection_metadata" table
CREATE TABLE "public"."collection_metadata" (
"collection_id" text NOT NULL,
Expand Down
4 changes: 2 additions & 2 deletions go/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
h1:Q+UeSEuBZon9dDhW0jtrv4UYIX0CkFd+WYE9xRH7hoM=
20240313233558.sql h1:WqdAFn0qL9z9fAItKv7kQuENhDpawT0FRsIrWDhLoJ0=
h1:Dp024rtdoEin0+duRRzaVGXblk6B0WSa0X3H/m4SRh8=
20240313233558.sql h1:shyeY6BuLGJ1Ia/G/hH+NZS6HZqHxhBJ2Pfdoeerz7I=
2 changes: 1 addition & 1 deletion k8s/distributed-chroma/templates/sysdb-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f16533

Please sign in to comment.