Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

collab: Update test database schema (#58670)

Marshall Bowers2ee00ba00494
diff --git a/crates/collab/migrations.sqlite/20221109000000_test_schema.sql b/crates/collab/migrations.sqlite/20221109000000_test_schema.sql
index 0ff6aa34f8e..730c3da9990 100644
--- a/crates/collab/migrations.sqlite/20221109000000_test_schema.sql
+++ b/crates/collab/migrations.sqlite/20221109000000_test_schema.sql
@@ -3,25 +3,18 @@
CREATE TABLE "users" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
- "github_login" VARCHAR,
"admin" BOOLEAN,
"email_address" VARCHAR(255) DEFAULT NULL,
"name" TEXT,
"connected_once" BOOLEAN NOT NULL DEFAULT false,
"created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
"metrics_id" TEXT,
- "github_user_id" INTEGER,
"accepted_tos_at" TIMESTAMP WITHOUT TIME ZONE,
- "github_user_created_at" TIMESTAMP WITHOUT TIME ZONE,
"custom_llm_monthly_allowance_in_cents" INTEGER
);
-CREATE UNIQUE INDEX "index_users_github_login" ON "users" ("github_login");
-
CREATE INDEX "index_users_on_email_address" ON "users" ("email_address");
-CREATE UNIQUE INDEX "index_users_on_github_user_id" ON "users" ("github_user_id");
-
CREATE TABLE "contacts" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"user_id_a" INTEGER NOT NULL,
@@ -163,6 +156,7 @@ CREATE TABLE "worktree_diagnostic_summaries" (
"language_server_id" INTEGER NOT NULL,
"error_count" INTEGER NOT NULL,
"warning_count" INTEGER NOT NULL,
+ "info_count" INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (project_id, worktree_id, path),
FOREIGN KEY (project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE
);
diff --git a/crates/collab/migrations/20251208000000_test_schema.sql b/crates/collab/migrations/20251208000000_test_schema.sql
index 44c9959d9c1..8b136c347ae 100644
--- a/crates/collab/migrations/20251208000000_test_schema.sql
+++ b/crates/collab/migrations/20251208000000_test_schema.sql
@@ -421,15 +421,12 @@ CREATE TABLE public.shared_threads (
CREATE TABLE public.users (
id integer NOT NULL,
- github_login character varying,
admin boolean NOT NULL,
email_address character varying(255) DEFAULT NULL::character varying,
connected_once boolean DEFAULT false NOT NULL,
created_at timestamp without time zone DEFAULT now() NOT NULL,
- github_user_id integer,
metrics_id uuid DEFAULT gen_random_uuid() NOT NULL,
accepted_tos_at timestamp without time zone,
- github_user_created_at timestamp without time zone,
custom_llm_monthly_allowance_in_cents integer,
name text
);
@@ -450,7 +447,8 @@ CREATE TABLE public.worktree_diagnostic_summaries (
path character varying NOT NULL,
language_server_id bigint NOT NULL,
error_count integer NOT NULL,
- warning_count integer NOT NULL
+ warning_count integer NOT NULL,
+ info_count integer DEFAULT 0 NOT NULL
);
CREATE TABLE public.worktree_entries (
@@ -700,8 +698,6 @@ CREATE INDEX index_settings_files_on_project_id ON public.worktree_settings_file
CREATE INDEX index_settings_files_on_project_id_and_wt_id ON public.worktree_settings_files USING btree (project_id, worktree_id);
-CREATE UNIQUE INDEX index_users_github_login ON public.users USING btree (github_login);
-
CREATE INDEX index_users_on_email_address ON public.users USING btree (email_address);
CREATE INDEX index_worktree_diagnostic_summaries_on_project_id ON public.worktree_diagnostic_summaries USING btree (project_id);
@@ -716,14 +712,10 @@ CREATE INDEX index_worktrees_on_project_id ON public.worktrees USING btree (proj
CREATE INDEX trigram_index_extensions_name ON public.extensions USING gin (name public.gin_trgm_ops);
-CREATE INDEX trigram_index_users_on_github_login ON public.users USING gin (github_login public.gin_trgm_ops);
-
CREATE INDEX trigram_index_users_on_name ON public.users USING gin (name public.gin_trgm_ops);
CREATE UNIQUE INDEX uix_channels_parent_path_name ON public.channels USING btree (parent_path, name) WHERE ((parent_path IS NOT NULL) AND (parent_path <> ''::text));
-CREATE UNIQUE INDEX uix_users_on_github_user_id ON public.users USING btree (github_user_id);
-
ALTER TABLE ONLY public.breakpoints
ADD CONSTRAINT breakpoints_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;