Skip to content

Commit

Permalink
[CLN] Stop clearing the sysdb on each deploy (#1941)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - ...
 - New functionality
	 - ...

## 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 28, 2024
1 parent 4da1a6c commit a78aede
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
13 changes: 10 additions & 3 deletions go/migrations/20240313233558.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
CREATE SCHEMA "public";

-- Create "collection_metadata" table
CREATE TABLE "public"."collection_metadata" (
"collection_id" text NOT NULL,
Expand All @@ -12,6 +10,7 @@ CREATE TABLE "public"."collection_metadata" (
"updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ("collection_id", "key")
);

-- Create "collections" table
CREATE TABLE "public"."collections" (
"id" text NOT NULL,
Expand All @@ -27,8 +26,10 @@ CREATE TABLE "public"."collections" (
"version" integer NULL DEFAULT 0,
PRIMARY KEY ("id")
);

-- Create index "uni_collections_name" to table: "collections"
CREATE UNIQUE INDEX "uni_collections_name" ON "public"."collections" ("name");

-- Create "databases" table
CREATE TABLE "public"."databases" (
"id" text NOT NULL,
Expand All @@ -40,8 +41,10 @@ CREATE TABLE "public"."databases" (
"updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ("id")
);

-- Create index "idx_tenantid_name" to table: "databases"
CREATE UNIQUE INDEX "idx_tenantid_name" ON "public"."databases" ("name", "tenant_id");

-- Create "notifications" table
CREATE TABLE "public"."notifications" (
"id" bigserial NOT NULL,
Expand All @@ -50,6 +53,7 @@ CREATE TABLE "public"."notifications" (
"status" text NULL,
PRIMARY KEY ("id")
);

-- Create "record_logs" table
CREATE TABLE "public"."record_logs" (
"collection_id" text NOT NULL,
Expand All @@ -58,6 +62,7 @@ CREATE TABLE "public"."record_logs" (
"record" bytea NULL,
PRIMARY KEY ("collection_id", "id")
);

-- Create "segment_metadata" table
CREATE TABLE "public"."segment_metadata" (
"segment_id" text NOT NULL,
Expand All @@ -70,6 +75,7 @@ CREATE TABLE "public"."segment_metadata" (
"updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ("segment_id", "key")
);

-- Create "segments" table
CREATE TABLE "public"."segments" (
"collection_id" text NOT NULL,
Expand All @@ -84,6 +90,7 @@ CREATE TABLE "public"."segments" (
"file_paths" text NULL DEFAULT '{}',
PRIMARY KEY ("collection_id", "id")
);

-- Create "tenants" table
CREATE TABLE "public"."tenants" (
"id" text NOT NULL,
Expand All @@ -93,4 +100,4 @@ CREATE TABLE "public"."tenants" (
"updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"last_compaction_time" bigint NOT NULL,
PRIMARY KEY ("id")
);
);
10 changes: 5 additions & 5 deletions go/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
h1:a7siLM7ZTF8njH6u0JLRctDcvTDu9/XNvTJ7hmLPyII=
20240313233558.sql h1:shyeY6BuLGJ1Ia/G/hH+NZS6HZqHxhBJ2Pfdoeerz7I=
20240321194713.sql h1:K5CAwiFb9kx+O8E/3Dq2C7jzMa7P+ZvqGL5HtLKe2YU=
20240327075032.sql h1:zE+/KCknuhtExHiKoZSfhFzahpbs2B7O/JgYbfxkjp0=
20240327172649.sql h1:hIFZlonLfEqJwmjC6nYn5xV6O8s8eA5y5JPc3BBbw+E=
h1:VbFQFcsAe42WZWS3v15Jp18vJIP/AYArDrUb5aMADIE=
20240313233558.sql h1:O7r3Z7JRfYqaWJKnYBKloTjWHd/cyFNP6l7s00d3tOk=
20240321194713.sql h1:3nBZIqllmYOaElhRP5wqJqArZZAVE3Zx+leQExleBw0=
20240327075032.sql h1:NphR9dlkaTW7Scc6gUa/EIf4UaIxhrH2cW+J3GkIVvw=
20240327172649.sql h1:cleZo0JtJMH3JxzUcH1tTJBGlzX6tRZFl+o1AgRywfk=
2 changes: 1 addition & 1 deletion k8s/distributed-chroma/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apiVersion: v2
name: distributed-chroma
description: A helm chart for distributed Chroma
type: application
version: 0.1.0
version: 0.1.2
appVersion: "0.4.23"
keywords:
- chroma
Expand Down
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 --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 }}"
- "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 a78aede

Please sign in to comment.