Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
collab: Remove database migrations (#44436)
Marshall Bowers8d44bcd4f978
diff --git a/crates/collab/migrations/20210527024318_initial_schema.sql b/crates/collab/migrations/20210527024318_initial_schema.sqldeleted file mode 100644index 4b065318484..00000000000--- a/crates/collab/migrations/20210527024318_initial_schema.sql+++ /dev/null@@ -1,20 +0,0 @@-CREATE TABLE IF NOT EXISTS "sessions" (- "id" VARCHAR NOT NULL PRIMARY KEY,- "expires" TIMESTAMP WITH TIME ZONE NULL,- "session" TEXT NOT NULL-);--CREATE TABLE IF NOT EXISTS "users" (- "id" SERIAL PRIMARY KEY,- "github_login" VARCHAR,- "admin" BOOLEAN-);--CREATE UNIQUE INDEX "index_users_github_login" ON "users" ("github_login");--CREATE TABLE IF NOT EXISTS "signups" (- "id" SERIAL PRIMARY KEY,- "github_login" VARCHAR,- "email_address" VARCHAR,- "about" TEXT-);diff --git a/crates/collab/migrations/20210607190313_create_access_tokens.sql b/crates/collab/migrations/20210607190313_create_access_tokens.sqldeleted file mode 100644index 60745a98bae..00000000000--- a/crates/collab/migrations/20210607190313_create_access_tokens.sql+++ /dev/null@@ -1,7 +0,0 @@-CREATE TABLE IF NOT EXISTS "access_tokens" (- "id" SERIAL PRIMARY KEY,- "user_id" INTEGER REFERENCES users (id),- "hash" VARCHAR(128)-);--CREATE INDEX "index_access_tokens_user_id" ON "access_tokens" ("user_id");diff --git a/crates/collab/migrations/20210805175147_create_chat_tables.sql b/crates/collab/migrations/20210805175147_create_chat_tables.sqldeleted file mode 100644index 5bba4689d9c..00000000000--- a/crates/collab/migrations/20210805175147_create_chat_tables.sql+++ /dev/null@@ -1,46 +0,0 @@-CREATE TABLE IF NOT EXISTS "orgs" (- "id" SERIAL PRIMARY KEY,- "name" VARCHAR NOT NULL,- "slug" VARCHAR NOT NULL-);--CREATE UNIQUE INDEX "index_orgs_slug" ON "orgs" ("slug");--CREATE TABLE IF NOT EXISTS "org_memberships" (- "id" SERIAL PRIMARY KEY,- "org_id" INTEGER REFERENCES orgs (id) NOT NULL,- "user_id" INTEGER REFERENCES users (id) NOT NULL,- "admin" BOOLEAN NOT NULL-);--CREATE INDEX "index_org_memberships_user_id" ON "org_memberships" ("user_id");-CREATE UNIQUE INDEX "index_org_memberships_org_id_and_user_id" ON "org_memberships" ("org_id", "user_id");--CREATE TABLE IF NOT EXISTS "channels" (- "id" SERIAL PRIMARY KEY,- "owner_id" INTEGER NOT NULL,- "owner_is_user" BOOLEAN NOT NULL,- "name" VARCHAR NOT NULL-);--CREATE UNIQUE INDEX "index_channels_owner_and_name" ON "channels" ("owner_is_user", "owner_id", "name");--CREATE TABLE IF NOT EXISTS "channel_memberships" (- "id" SERIAL PRIMARY KEY,- "channel_id" INTEGER REFERENCES channels (id) NOT NULL,- "user_id" INTEGER REFERENCES users (id) NOT NULL,- "admin" BOOLEAN NOT NULL-);--CREATE INDEX "index_channel_memberships_user_id" ON "channel_memberships" ("user_id");-CREATE UNIQUE INDEX "index_channel_memberships_channel_id_and_user_id" ON "channel_memberships" ("channel_id", "user_id");--CREATE TABLE IF NOT EXISTS "channel_messages" (- "id" SERIAL PRIMARY KEY,- "channel_id" INTEGER REFERENCES channels (id) NOT NULL,- "sender_id" INTEGER REFERENCES users (id) NOT NULL,- "body" TEXT NOT NULL,- "sent_at" TIMESTAMP-);--CREATE INDEX "index_channel_messages_channel_id" ON "channel_messages" ("channel_id");diff --git a/crates/collab/migrations/20210916123647_add_nonce_to_channel_messages.sql b/crates/collab/migrations/20210916123647_add_nonce_to_channel_messages.sqldeleted file mode 100644index ee4d4aa319f..00000000000--- a/crates/collab/migrations/20210916123647_add_nonce_to_channel_messages.sql+++ /dev/null@@ -1,4 +0,0 @@-ALTER TABLE "channel_messages"-ADD "nonce" UUID NOT NULL DEFAULT gen_random_uuid();--CREATE UNIQUE INDEX "index_channel_messages_nonce" ON "channel_messages" ("nonce");diff --git a/crates/collab/migrations/20210920192001_add_interests_to_signups.sql b/crates/collab/migrations/20210920192001_add_interests_to_signups.sqldeleted file mode 100644index 2457abfc757..00000000000--- a/crates/collab/migrations/20210920192001_add_interests_to_signups.sql+++ /dev/null@@ -1,4 +0,0 @@-ALTER TABLE "signups"- ADD "wants_releases" BOOLEAN,- ADD "wants_updates" BOOLEAN,- ADD "wants_community" BOOLEAN;\ No newline at end of filediff --git a/crates/collab/migrations/20220421165757_drop_signups.sql b/crates/collab/migrations/20220421165757_drop_signups.sqldeleted file mode 100644index d7cd6e204c9..00000000000--- a/crates/collab/migrations/20220421165757_drop_signups.sql+++ /dev/null@@ -1 +0,0 @@-DROP TABLE IF EXISTS "signups";diff --git a/crates/collab/migrations/20220505144506_add_trigram_index_to_users.sql b/crates/collab/migrations/20220505144506_add_trigram_index_to_users.sqldeleted file mode 100644index 3d6fd3179a2..00000000000--- a/crates/collab/migrations/20220505144506_add_trigram_index_to_users.sql+++ /dev/null@@ -1,2 +0,0 @@-CREATE EXTENSION IF NOT EXISTS pg_trgm;-CREATE INDEX trigram_index_users_on_github_login ON users USING GIN(github_login gin_trgm_ops);diff --git a/crates/collab/migrations/20220506130724_create_contacts.sql b/crates/collab/migrations/20220506130724_create_contacts.sqldeleted file mode 100644index 56beb70fd06..00000000000--- a/crates/collab/migrations/20220506130724_create_contacts.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE IF NOT EXISTS "contacts" (- "id" SERIAL PRIMARY KEY,- "user_id_a" INTEGER REFERENCES users (id) NOT NULL,- "user_id_b" INTEGER REFERENCES users (id) NOT NULL,- "a_to_b" BOOLEAN NOT NULL,- "should_notify" BOOLEAN NOT NULL,- "accepted" BOOLEAN NOT NULL-);--CREATE UNIQUE INDEX "index_contacts_user_ids" ON "contacts" ("user_id_a", "user_id_b");-CREATE INDEX "index_contacts_user_id_b" ON "contacts" ("user_id_b");diff --git a/crates/collab/migrations/20220518151305_add_invites_to_users.sql b/crates/collab/migrations/20220518151305_add_invites_to_users.sqldeleted file mode 100644index 2ac89b649e8..00000000000--- a/crates/collab/migrations/20220518151305_add_invites_to_users.sql+++ /dev/null@@ -1,9 +0,0 @@-ALTER TABLE users-ADD email_address VARCHAR(255) DEFAULT NULL,-ADD invite_code VARCHAR(64),-ADD invite_count INTEGER NOT NULL DEFAULT 0,-ADD inviter_id INTEGER REFERENCES users (id),-ADD connected_once BOOLEAN NOT NULL DEFAULT false,-ADD created_at TIMESTAMP NOT NULL DEFAULT NOW();--CREATE UNIQUE INDEX "index_invite_code_users" ON "users" ("invite_code");diff --git a/crates/collab/migrations/20220523232954_allow_user_deletes.sql b/crates/collab/migrations/20220523232954_allow_user_deletes.sqldeleted file mode 100644index ddf3f6f9bd0..00000000000--- a/crates/collab/migrations/20220523232954_allow_user_deletes.sql+++ /dev/null@@ -1,6 +0,0 @@-ALTER TABLE contacts DROP CONSTRAINT contacts_user_id_a_fkey;-ALTER TABLE contacts DROP CONSTRAINT contacts_user_id_b_fkey;-ALTER TABLE contacts ADD CONSTRAINT contacts_user_id_a_fkey FOREIGN KEY (user_id_a) REFERENCES users(id) ON DELETE CASCADE;-ALTER TABLE contacts ADD CONSTRAINT contacts_user_id_b_fkey FOREIGN KEY (user_id_b) REFERENCES users(id) ON DELETE CASCADE;-ALTER TABLE users DROP CONSTRAINT users_inviter_id_fkey;-ALTER TABLE users ADD CONSTRAINT users_inviter_id_fkey FOREIGN KEY (inviter_id) REFERENCES users(id) ON DELETE SET NULL;diff --git a/crates/collab/migrations/20220620211403_create_projects.sql b/crates/collab/migrations/20220620211403_create_projects.sqldeleted file mode 100644index d813c9f7a18..00000000000--- a/crates/collab/migrations/20220620211403_create_projects.sql+++ /dev/null@@ -1,24 +0,0 @@-CREATE TABLE IF NOT EXISTS "projects" (- "id" SERIAL PRIMARY KEY,- "host_user_id" INTEGER REFERENCES users (id) NOT NULL,- "unregistered" BOOLEAN NOT NULL DEFAULT false-);--CREATE TABLE IF NOT EXISTS "worktree_extensions" (- "id" SERIAL PRIMARY KEY,- "project_id" INTEGER REFERENCES projects (id) NOT NULL,- "worktree_id" INTEGER NOT NULL,- "extension" VARCHAR(255),- "count" INTEGER NOT NULL-);--CREATE TABLE IF NOT EXISTS "project_activity_periods" (- "id" SERIAL PRIMARY KEY,- "duration_millis" INTEGER NOT NULL,- "ended_at" TIMESTAMP NOT NULL,- "user_id" INTEGER REFERENCES users (id) NOT NULL,- "project_id" INTEGER REFERENCES projects (id) NOT NULL-);--CREATE INDEX "index_project_activity_periods_on_ended_at" ON "project_activity_periods" ("ended_at");-CREATE UNIQUE INDEX "index_worktree_extensions_on_project_id_and_worktree_id_and_extension" ON "worktree_extensions" ("project_id", "worktree_id", "extension");\ No newline at end of filediff --git a/crates/collab/migrations/20220913211150_create_signups.sql b/crates/collab/migrations/20220913211150_create_signups.sqldeleted file mode 100644index 19559b747c3..00000000000--- a/crates/collab/migrations/20220913211150_create_signups.sql+++ /dev/null@@ -1,27 +0,0 @@-CREATE TABLE IF NOT EXISTS "signups" (- "id" SERIAL PRIMARY KEY,- "email_address" VARCHAR NOT NULL,- "email_confirmation_code" VARCHAR(64) NOT NULL,- "email_confirmation_sent" BOOLEAN NOT NULL,- "created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,- "device_id" VARCHAR,- "user_id" INTEGER REFERENCES users (id) ON DELETE CASCADE,- "inviting_user_id" INTEGER REFERENCES users (id) ON DELETE SET NULL,-- "platform_mac" BOOLEAN NOT NULL,- "platform_linux" BOOLEAN NOT NULL,- "platform_windows" BOOLEAN NOT NULL,- "platform_unknown" BOOLEAN NOT NULL,-- "editor_features" VARCHAR[],- "programming_languages" VARCHAR[]-);--CREATE UNIQUE INDEX "index_signups_on_email_address" ON "signups" ("email_address");-CREATE INDEX "index_signups_on_email_confirmation_sent" ON "signups" ("email_confirmation_sent");--ALTER TABLE "users"- ADD "github_user_id" INTEGER;--CREATE INDEX "index_users_on_email_address" ON "users" ("email_address");-CREATE INDEX "index_users_on_github_user_id" ON "users" ("github_user_id");diff --git a/crates/collab/migrations/20220929182110_add_metrics_id.sql b/crates/collab/migrations/20220929182110_add_metrics_id.sqldeleted file mode 100644index 665d6323bf1..00000000000--- a/crates/collab/migrations/20220929182110_add_metrics_id.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "users"- ADD "metrics_id" uuid NOT NULL DEFAULT gen_random_uuid();diff --git a/crates/collab/migrations/20221111092550_reconnection_support.sql b/crates/collab/migrations/20221111092550_reconnection_support.sqldeleted file mode 100644index 3289f6bbddb..00000000000--- a/crates/collab/migrations/20221111092550_reconnection_support.sql+++ /dev/null@@ -1,90 +0,0 @@-CREATE TABLE IF NOT EXISTS "rooms" (- "id" SERIAL PRIMARY KEY,- "live_kit_room" VARCHAR NOT NULL-);--ALTER TABLE "projects"- ADD "room_id" INTEGER REFERENCES rooms (id),- ADD "host_connection_id" INTEGER,- ADD "host_connection_epoch" UUID;-CREATE INDEX "index_projects_on_host_connection_epoch" ON "projects" ("host_connection_epoch");--CREATE TABLE "worktrees" (- "project_id" INTEGER NOT NULL REFERENCES projects (id) ON DELETE CASCADE,- "id" INT8 NOT NULL,- "root_name" VARCHAR NOT NULL,- "abs_path" VARCHAR NOT NULL,- "visible" BOOL NOT NULL,- "scan_id" INT8 NOT NULL,- "is_complete" BOOL NOT NULL,- PRIMARY KEY(project_id, id)-);-CREATE INDEX "index_worktrees_on_project_id" ON "worktrees" ("project_id");--CREATE TABLE "worktree_entries" (- "project_id" INTEGER NOT NULL,- "worktree_id" INT8 NOT NULL,- "id" INT8 NOT NULL,- "is_dir" BOOL NOT NULL,- "path" VARCHAR NOT NULL,- "inode" INT8 NOT NULL,- "mtime_seconds" INT8 NOT NULL,- "mtime_nanos" INTEGER NOT NULL,- "is_symlink" BOOL NOT NULL,- "is_ignored" BOOL NOT NULL,- PRIMARY KEY(project_id, worktree_id, id),- FOREIGN KEY(project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE-);-CREATE INDEX "index_worktree_entries_on_project_id" ON "worktree_entries" ("project_id");-CREATE INDEX "index_worktree_entries_on_project_id_and_worktree_id" ON "worktree_entries" ("project_id", "worktree_id");--CREATE TABLE "worktree_diagnostic_summaries" (- "project_id" INTEGER NOT NULL,- "worktree_id" INT8 NOT NULL,- "path" VARCHAR NOT NULL,- "language_server_id" INT8 NOT NULL,- "error_count" INTEGER NOT NULL,- "warning_count" INTEGER NOT NULL,- PRIMARY KEY(project_id, worktree_id, path),- FOREIGN KEY(project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE-);-CREATE INDEX "index_worktree_diagnostic_summaries_on_project_id" ON "worktree_diagnostic_summaries" ("project_id");-CREATE INDEX "index_worktree_diagnostic_summaries_on_project_id_and_worktree_id" ON "worktree_diagnostic_summaries" ("project_id", "worktree_id");--CREATE TABLE "language_servers" (- "project_id" INTEGER NOT NULL REFERENCES projects (id) ON DELETE CASCADE,- "id" INT8 NOT NULL,- "name" VARCHAR NOT NULL,- PRIMARY KEY(project_id, id)-);-CREATE INDEX "index_language_servers_on_project_id" ON "language_servers" ("project_id");--CREATE TABLE "project_collaborators" (- "id" SERIAL PRIMARY KEY,- "project_id" INTEGER NOT NULL REFERENCES projects (id) ON DELETE CASCADE,- "connection_id" INTEGER NOT NULL,- "connection_epoch" UUID NOT NULL,- "user_id" INTEGER NOT NULL,- "replica_id" INTEGER NOT NULL,- "is_host" BOOLEAN NOT NULL-);-CREATE INDEX "index_project_collaborators_on_project_id" ON "project_collaborators" ("project_id");-CREATE UNIQUE INDEX "index_project_collaborators_on_project_id_and_replica_id" ON "project_collaborators" ("project_id", "replica_id");-CREATE INDEX "index_project_collaborators_on_connection_epoch" ON "project_collaborators" ("connection_epoch");--CREATE TABLE "room_participants" (- "id" SERIAL PRIMARY KEY,- "room_id" INTEGER NOT NULL REFERENCES rooms (id),- "user_id" INTEGER NOT NULL REFERENCES users (id),- "answering_connection_id" INTEGER,- "answering_connection_epoch" UUID,- "location_kind" INTEGER,- "location_project_id" INTEGER,- "initial_project_id" INTEGER,- "calling_user_id" INTEGER NOT NULL REFERENCES users (id),- "calling_connection_id" INTEGER NOT NULL,- "calling_connection_epoch" UUID NOT NULL-);-CREATE UNIQUE INDEX "index_room_participants_on_user_id" ON "room_participants" ("user_id");-CREATE INDEX "index_room_participants_on_answering_connection_epoch" ON "room_participants" ("answering_connection_epoch");-CREATE INDEX "index_room_participants_on_calling_connection_epoch" ON "room_participants" ("calling_connection_epoch");diff --git a/crates/collab/migrations/20221125192125_add_added_to_mailing_list_to_signups.sql b/crates/collab/migrations/20221125192125_add_added_to_mailing_list_to_signups.sqldeleted file mode 100644index b154396df12..00000000000--- a/crates/collab/migrations/20221125192125_add_added_to_mailing_list_to_signups.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "signups"- ADD "added_to_mailing_list" BOOLEAN NOT NULL DEFAULT FALSE;\ No newline at end of filediff --git a/crates/collab/migrations/20221207165001_add_connection_lost_to_room_participants.sql b/crates/collab/migrations/20221207165001_add_connection_lost_to_room_participants.sqldeleted file mode 100644index ed0cf972bc9..00000000000--- a/crates/collab/migrations/20221207165001_add_connection_lost_to_room_participants.sql+++ /dev/null@@ -1,7 +0,0 @@-ALTER TABLE "room_participants"- ADD "answering_connection_lost" BOOLEAN NOT NULL DEFAULT FALSE;--CREATE INDEX "index_project_collaborators_on_connection_id" ON "project_collaborators" ("connection_id");-CREATE UNIQUE INDEX "index_project_collaborators_on_project_id_connection_id_and_epoch" ON "project_collaborators" ("project_id", "connection_id", "connection_epoch");-CREATE INDEX "index_room_participants_on_answering_connection_id" ON "room_participants" ("answering_connection_id");-CREATE UNIQUE INDEX "index_room_participants_on_answering_connection_id_and_answering_connection_epoch" ON "room_participants" ("answering_connection_id", "answering_connection_epoch");diff --git a/crates/collab/migrations/20221213125710_index_room_participants_on_room_id.sql b/crates/collab/migrations/20221213125710_index_room_participants_on_room_id.sqldeleted file mode 100644index f40ca81906f..00000000000--- a/crates/collab/migrations/20221213125710_index_room_participants_on_room_id.sql+++ /dev/null@@ -1 +0,0 @@-CREATE INDEX "index_room_participants_on_room_id" ON "room_participants" ("room_id");diff --git a/crates/collab/migrations/20221214144346_change_epoch_from_uuid_to_integer.sql b/crates/collab/migrations/20221214144346_change_epoch_from_uuid_to_integer.sqldeleted file mode 100644index 5e02f76ce25..00000000000--- a/crates/collab/migrations/20221214144346_change_epoch_from_uuid_to_integer.sql+++ /dev/null@@ -1,30 +0,0 @@-CREATE TABLE servers (- id SERIAL PRIMARY KEY,- environment VARCHAR NOT NULL-);--DROP TABLE worktree_extensions;-DROP TABLE project_activity_periods;-DELETE from projects;-ALTER TABLE projects- DROP COLUMN host_connection_epoch,- ADD COLUMN host_connection_server_id INTEGER REFERENCES servers (id) ON DELETE CASCADE;-CREATE INDEX "index_projects_on_host_connection_server_id" ON "projects" ("host_connection_server_id");-CREATE INDEX "index_projects_on_host_connection_id_and_host_connection_server_id" ON "projects" ("host_connection_id", "host_connection_server_id");--DELETE FROM project_collaborators;-ALTER TABLE project_collaborators- DROP COLUMN connection_epoch,- ADD COLUMN connection_server_id INTEGER NOT NULL REFERENCES servers (id) ON DELETE CASCADE;-CREATE INDEX "index_project_collaborators_on_connection_server_id" ON "project_collaborators" ("connection_server_id");-CREATE UNIQUE INDEX "index_project_collaborators_on_project_id_connection_id_and_server_id" ON "project_collaborators" ("project_id", "connection_id", "connection_server_id");--DELETE FROM room_participants;-ALTER TABLE room_participants- DROP COLUMN answering_connection_epoch,- DROP COLUMN calling_connection_epoch,- ADD COLUMN answering_connection_server_id INTEGER REFERENCES servers (id) ON DELETE CASCADE,- ADD COLUMN calling_connection_server_id INTEGER REFERENCES servers (id) ON DELETE SET NULL;-CREATE INDEX "index_room_participants_on_answering_connection_server_id" ON "room_participants" ("answering_connection_server_id");-CREATE INDEX "index_room_participants_on_calling_connection_server_id" ON "room_participants" ("calling_connection_server_id");-CREATE UNIQUE INDEX "index_room_participants_on_answering_connection_id_and_answering_connection_server_id" ON "room_participants" ("answering_connection_id", "answering_connection_server_id");diff --git a/crates/collab/migrations/20221219181850_project_reconnection_support.sql b/crates/collab/migrations/20221219181850_project_reconnection_support.sqldeleted file mode 100644index 6efef5571c5..00000000000--- a/crates/collab/migrations/20221219181850_project_reconnection_support.sql+++ /dev/null@@ -1,3 +0,0 @@-ALTER TABLE "worktree_entries"- ADD COLUMN "scan_id" INT8,- ADD COLUMN "is_deleted" BOOL;diff --git a/crates/collab/migrations/20230103200902_replace_is_completed_with_completed_scan_id.sql b/crates/collab/migrations/20230103200902_replace_is_completed_with_completed_scan_id.sqldeleted file mode 100644index 1894d888b92..00000000000--- a/crates/collab/migrations/20230103200902_replace_is_completed_with_completed_scan_id.sql+++ /dev/null@@ -1,3 +0,0 @@-ALTER TABLE worktrees- ALTER COLUMN is_complete SET DEFAULT FALSE,- ADD COLUMN completed_scan_id INT8;diff --git a/crates/collab/migrations/20230202155735_followers.sql b/crates/collab/migrations/20230202155735_followers.sqldeleted file mode 100644index c82d6ba3bda..00000000000--- a/crates/collab/migrations/20230202155735_followers.sql+++ /dev/null@@ -1,15 +0,0 @@-CREATE TABLE IF NOT EXISTS "followers" (- "id" SERIAL PRIMARY KEY,- "room_id" INTEGER NOT NULL REFERENCES rooms (id) ON DELETE CASCADE,- "project_id" INTEGER NOT NULL REFERENCES projects (id) ON DELETE CASCADE,- "leader_connection_server_id" INTEGER NOT NULL REFERENCES servers (id) ON DELETE CASCADE,- "leader_connection_id" INTEGER NOT NULL,- "follower_connection_server_id" INTEGER NOT NULL REFERENCES servers (id) ON DELETE CASCADE,- "follower_connection_id" INTEGER NOT NULL-);--CREATE UNIQUE INDEX- "index_followers_on_project_id_and_leader_connection_server_id_and_leader_connection_id_and_follower_connection_server_id_and_follower_connection_id"-ON "followers" ("project_id", "leader_connection_server_id", "leader_connection_id", "follower_connection_server_id", "follower_connection_id");--CREATE INDEX "index_followers_on_room_id" ON "followers" ("room_id");diff --git a/crates/collab/migrations/20230508211523_add-repository-entries.sql b/crates/collab/migrations/20230508211523_add-repository-entries.sqldeleted file mode 100644index 1e593479394..00000000000--- a/crates/collab/migrations/20230508211523_add-repository-entries.sql+++ /dev/null@@ -1,13 +0,0 @@-CREATE TABLE "worktree_repositories" (- "project_id" INTEGER NOT NULL,- "worktree_id" INT8 NOT NULL,- "work_directory_id" INT8 NOT NULL,- "scan_id" INT8 NOT NULL,- "branch" VARCHAR,- "is_deleted" BOOL NOT NULL,- PRIMARY KEY(project_id, worktree_id, work_directory_id),- FOREIGN KEY(project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE,- FOREIGN KEY(project_id, worktree_id, work_directory_id) REFERENCES worktree_entries (project_id, worktree_id, id) ON DELETE CASCADE-);-CREATE INDEX "index_worktree_repositories_on_project_id" ON "worktree_repositories" ("project_id");-CREATE INDEX "index_worktree_repositories_on_project_id_and_worktree_id" ON "worktree_repositories" ("project_id", "worktree_id");diff --git a/crates/collab/migrations/20230511004019_add_repository_statuses.sql b/crates/collab/migrations/20230511004019_add_repository_statuses.sqldeleted file mode 100644index 862561c6866..00000000000--- a/crates/collab/migrations/20230511004019_add_repository_statuses.sql+++ /dev/null@@ -1,15 +0,0 @@-CREATE TABLE "worktree_repository_statuses" (- "project_id" INTEGER NOT NULL,- "worktree_id" INT8 NOT NULL,- "work_directory_id" INT8 NOT NULL,- "repo_path" VARCHAR NOT NULL,- "status" INT8 NOT NULL,- "scan_id" INT8 NOT NULL,- "is_deleted" BOOL NOT NULL,- PRIMARY KEY(project_id, worktree_id, work_directory_id, repo_path),- FOREIGN KEY(project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE,- FOREIGN KEY(project_id, worktree_id, work_directory_id) REFERENCES worktree_entries (project_id, worktree_id, id) ON DELETE CASCADE-);-CREATE INDEX "index_wt_repos_statuses_on_project_id" ON "worktree_repository_statuses" ("project_id");-CREATE INDEX "index_wt_repos_statuses_on_project_id_and_wt_id" ON "worktree_repository_statuses" ("project_id", "worktree_id");-CREATE INDEX "index_wt_repos_statuses_on_project_id_and_wt_id_and_wd_id" ON "worktree_repository_statuses" ("project_id", "worktree_id", "work_directory_id");diff --git a/crates/collab/migrations/20230529164700_add_worktree_settings_files.sql b/crates/collab/migrations/20230529164700_add_worktree_settings_files.sqldeleted file mode 100644index 973a40af0f2..00000000000--- a/crates/collab/migrations/20230529164700_add_worktree_settings_files.sql+++ /dev/null@@ -1,10 +0,0 @@-CREATE TABLE "worktree_settings_files" (- "project_id" INTEGER NOT NULL,- "worktree_id" INT8 NOT NULL,- "path" VARCHAR NOT NULL,- "content" TEXT NOT NULL,- PRIMARY KEY(project_id, worktree_id, path),- FOREIGN KEY(project_id, worktree_id) REFERENCES worktrees (project_id, id) ON DELETE CASCADE-);-CREATE INDEX "index_settings_files_on_project_id" ON "worktree_settings_files" ("project_id");-CREATE INDEX "index_settings_files_on_project_id_and_wt_id" ON "worktree_settings_files" ("project_id", "worktree_id");diff --git a/crates/collab/migrations/20230605191135_remove_repository_statuses.sql b/crates/collab/migrations/20230605191135_remove_repository_statuses.sqldeleted file mode 100644index 3e5f907c442..00000000000--- a/crates/collab/migrations/20230605191135_remove_repository_statuses.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "worktree_entries"-ADD "git_status" INT8;diff --git a/crates/collab/migrations/20230616134535_add_is_external_to_worktree_entries.sql b/crates/collab/migrations/20230616134535_add_is_external_to_worktree_entries.sqldeleted file mode 100644index e4348af0cc5..00000000000--- a/crates/collab/migrations/20230616134535_add_is_external_to_worktree_entries.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "worktree_entries"-ADD "is_external" BOOL NOT NULL DEFAULT FALSE;diff --git a/crates/collab/migrations/20230727150500_add_channels.sql b/crates/collab/migrations/20230727150500_add_channels.sqldeleted file mode 100644index df981838bf7..00000000000--- a/crates/collab/migrations/20230727150500_add_channels.sql+++ /dev/null@@ -1,30 +0,0 @@-DROP TABLE "channel_messages";-DROP TABLE "channel_memberships";-DROP TABLE "org_memberships";-DROP TABLE "orgs";-DROP TABLE "channels";--CREATE TABLE "channels" (- "id" SERIAL PRIMARY KEY,- "name" VARCHAR NOT NULL,- "created_at" TIMESTAMP NOT NULL DEFAULT now()-);--CREATE TABLE "channel_paths" (- "id_path" VARCHAR NOT NULL PRIMARY KEY,- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE-);-CREATE INDEX "index_channel_paths_on_channel_id" ON "channel_paths" ("channel_id");--CREATE TABLE "channel_members" (- "id" SERIAL PRIMARY KEY,- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,- "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,- "admin" BOOLEAN NOT NULL DEFAULT false,- "accepted" BOOLEAN NOT NULL DEFAULT false,- "updated_at" TIMESTAMP NOT NULL DEFAULT now()-);--CREATE UNIQUE INDEX "index_channel_members_on_channel_id_and_user_id" ON "channel_members" ("channel_id", "user_id");--ALTER TABLE rooms ADD COLUMN "channel_id" INTEGER REFERENCES channels (id) ON DELETE CASCADE;diff --git a/crates/collab/migrations/20230819154600_add_channel_buffers.sql b/crates/collab/migrations/20230819154600_add_channel_buffers.sqldeleted file mode 100644index 5e6e7ce3393..00000000000--- a/crates/collab/migrations/20230819154600_add_channel_buffers.sql+++ /dev/null@@ -1,40 +0,0 @@-CREATE TABLE "buffers" (- "id" SERIAL PRIMARY KEY,- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,- "epoch" INTEGER NOT NULL DEFAULT 0-);--CREATE INDEX "index_buffers_on_channel_id" ON "buffers" ("channel_id");--CREATE TABLE "buffer_operations" (- "buffer_id" INTEGER NOT NULL REFERENCES buffers (id) ON DELETE CASCADE,- "epoch" INTEGER NOT NULL,- "replica_id" INTEGER NOT NULL,- "lamport_timestamp" INTEGER NOT NULL,- "value" BYTEA NOT NULL,- PRIMARY KEY(buffer_id, epoch, lamport_timestamp, replica_id)-);--CREATE TABLE "buffer_snapshots" (- "buffer_id" INTEGER NOT NULL REFERENCES buffers (id) ON DELETE CASCADE,- "epoch" INTEGER NOT NULL,- "text" TEXT NOT NULL,- "operation_serialization_version" INTEGER NOT NULL,- PRIMARY KEY(buffer_id, epoch)-);--CREATE TABLE "channel_buffer_collaborators" (- "id" SERIAL PRIMARY KEY,- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,- "connection_id" INTEGER NOT NULL,- "connection_server_id" INTEGER NOT NULL REFERENCES servers (id) ON DELETE CASCADE,- "connection_lost" BOOLEAN NOT NULL DEFAULT FALSE,- "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,- "replica_id" INTEGER NOT NULL-);--CREATE INDEX "index_channel_buffer_collaborators_on_channel_id" ON "channel_buffer_collaborators" ("channel_id");-CREATE UNIQUE INDEX "index_channel_buffer_collaborators_on_channel_id_and_replica_id" ON "channel_buffer_collaborators" ("channel_id", "replica_id");-CREATE INDEX "index_channel_buffer_collaborators_on_connection_server_id" ON "channel_buffer_collaborators" ("connection_server_id");-CREATE INDEX "index_channel_buffer_collaborators_on_connection_id" ON "channel_buffer_collaborators" ("connection_id");-CREATE UNIQUE INDEX "index_channel_buffer_collaborators_on_channel_id_connection_id_and_server_id" ON "channel_buffer_collaborators" ("channel_id", "connection_id", "connection_server_id");diff --git a/crates/collab/migrations/20230825190322_add_server_feature_flags.sql b/crates/collab/migrations/20230825190322_add_server_feature_flags.sqldeleted file mode 100644index fffde54a20e..00000000000--- a/crates/collab/migrations/20230825190322_add_server_feature_flags.sql+++ /dev/null@@ -1,16 +0,0 @@-CREATE TABLE "feature_flags" (- "id" SERIAL PRIMARY KEY,- "flag" VARCHAR(255) NOT NULL UNIQUE-);--CREATE UNIQUE INDEX "index_feature_flags" ON "feature_flags" ("id");--CREATE TABLE "user_features" (- "user_id" INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,- "feature_id" INTEGER NOT NULL REFERENCES feature_flags(id) ON DELETE CASCADE,- PRIMARY KEY (user_id, feature_id)-);--CREATE UNIQUE INDEX "index_user_features_user_id_and_feature_id" ON "user_features" ("user_id", "feature_id");-CREATE INDEX "index_user_features_on_user_id" ON "user_features" ("user_id");-CREATE INDEX "index_user_features_on_feature_id" ON "user_features" ("feature_id");diff --git a/crates/collab/migrations/20230907114200_add_channel_messages.sql b/crates/collab/migrations/20230907114200_add_channel_messages.sqldeleted file mode 100644index abe7753ca69..00000000000--- a/crates/collab/migrations/20230907114200_add_channel_messages.sql+++ /dev/null@@ -1,19 +0,0 @@-CREATE TABLE IF NOT EXISTS "channel_messages" (- "id" SERIAL PRIMARY KEY,- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,- "sender_id" INTEGER NOT NULL REFERENCES users (id),- "body" TEXT NOT NULL,- "sent_at" TIMESTAMP,- "nonce" UUID NOT NULL-);-CREATE INDEX "index_channel_messages_on_channel_id" ON "channel_messages" ("channel_id");-CREATE UNIQUE INDEX "index_channel_messages_on_nonce" ON "channel_messages" ("nonce");--CREATE TABLE IF NOT EXISTS "channel_chat_participants" (- "id" SERIAL PRIMARY KEY,- "user_id" INTEGER NOT NULL REFERENCES users (id),- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,- "connection_id" INTEGER NOT NULL,- "connection_server_id" INTEGER NOT NULL REFERENCES servers (id) ON DELETE CASCADE-);-CREATE INDEX "index_channel_chat_participants_on_channel_id" ON "channel_chat_participants" ("channel_id");diff --git a/crates/collab/migrations/20230925210437_add_channel_changes.sql b/crates/collab/migrations/20230925210437_add_channel_changes.sqldeleted file mode 100644index 250a9ac731b..00000000000--- a/crates/collab/migrations/20230925210437_add_channel_changes.sql+++ /dev/null@@ -1,19 +0,0 @@-CREATE TABLE IF NOT EXISTS "observed_buffer_edits" (- "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,- "buffer_id" INTEGER NOT NULL REFERENCES buffers (id) ON DELETE CASCADE,- "epoch" INTEGER NOT NULL,- "lamport_timestamp" INTEGER NOT NULL,- "replica_id" INTEGER NOT NULL,- PRIMARY KEY (user_id, buffer_id)-);--CREATE UNIQUE INDEX "index_observed_buffer_user_and_buffer_id" ON "observed_buffer_edits" ("user_id", "buffer_id");--CREATE TABLE IF NOT EXISTS "observed_channel_messages" (- "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,- "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,- "channel_message_id" INTEGER NOT NULL,- PRIMARY KEY (user_id, channel_id)-);--CREATE UNIQUE INDEX "index_observed_channel_messages_user_and_channel_id" ON "observed_channel_messages" ("user_id", "channel_id");diff --git a/crates/collab/migrations/20230926102500_add_participant_index_to_room_participants.sql b/crates/collab/migrations/20230926102500_add_participant_index_to_room_participants.sqldeleted file mode 100644index 1493119e2a9..00000000000--- a/crates/collab/migrations/20230926102500_add_participant_index_to_room_participants.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE room_participants ADD COLUMN participant_index INTEGER;diff --git a/crates/collab/migrations/20231004130100_create_notifications.sql b/crates/collab/migrations/20231004130100_create_notifications.sqldeleted file mode 100644index 93c282c631f..00000000000--- a/crates/collab/migrations/20231004130100_create_notifications.sql+++ /dev/null@@ -1,22 +0,0 @@-CREATE TABLE "notification_kinds" (- "id" SERIAL PRIMARY KEY,- "name" VARCHAR NOT NULL-);--CREATE UNIQUE INDEX "index_notification_kinds_on_name" ON "notification_kinds" ("name");--CREATE TABLE notifications (- "id" SERIAL PRIMARY KEY,- "created_at" TIMESTAMP NOT NULL DEFAULT now(),- "recipient_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,- "kind" INTEGER NOT NULL REFERENCES notification_kinds (id),- "entity_id" INTEGER,- "content" TEXT,- "is_read" BOOLEAN NOT NULL DEFAULT FALSE,- "response" BOOLEAN-);--CREATE INDEX- "index_notifications_on_recipient_id_is_read_kind_entity_id"- ON "notifications"- ("recipient_id", "is_read", "kind", "entity_id");diff --git a/crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sql b/crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sqldeleted file mode 100644index 8f3a704adde..00000000000--- a/crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE rooms ADD COLUMN enviroment TEXT;diff --git a/crates/collab/migrations/20231010114600_add_unique_index_on_rooms_channel_id.sql b/crates/collab/migrations/20231010114600_add_unique_index_on_rooms_channel_id.sqldeleted file mode 100644index 21ec4cfbb75..00000000000--- a/crates/collab/migrations/20231010114600_add_unique_index_on_rooms_channel_id.sql+++ /dev/null@@ -1 +0,0 @@-CREATE UNIQUE INDEX "index_rooms_on_channel_id" ON "rooms" ("channel_id");diff --git a/crates/collab/migrations/20231011214412_add_guest_role.sql b/crates/collab/migrations/20231011214412_add_guest_role.sqldeleted file mode 100644index 17135471583..00000000000--- a/crates/collab/migrations/20231011214412_add_guest_role.sql+++ /dev/null@@ -1,4 +0,0 @@-ALTER TABLE channel_members ADD COLUMN role TEXT;-UPDATE channel_members SET role = CASE WHEN admin THEN 'admin' ELSE 'member' END;--ALTER TABLE channels ADD COLUMN visibility TEXT NOT NULL DEFAULT 'members';diff --git a/crates/collab/migrations/20231017185833_projects_room_id_fkey_on_delete_cascade.sql b/crates/collab/migrations/20231017185833_projects_room_id_fkey_on_delete_cascade.sqldeleted file mode 100644index be535ff7fa6..00000000000--- a/crates/collab/migrations/20231017185833_projects_room_id_fkey_on_delete_cascade.sql+++ /dev/null@@ -1,8 +0,0 @@--- Add migration script here--ALTER TABLE projects- DROP CONSTRAINT projects_room_id_fkey,- ADD CONSTRAINT projects_room_id_fkey- FOREIGN KEY (room_id)- REFERENCES rooms (id)- ON DELETE CASCADE;diff --git a/crates/collab/migrations/20231018102700_create_mentions.sql b/crates/collab/migrations/20231018102700_create_mentions.sqldeleted file mode 100644index 221a1748cfe..00000000000--- a/crates/collab/migrations/20231018102700_create_mentions.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE "channel_message_mentions" (- "message_id" INTEGER NOT NULL REFERENCES channel_messages (id) ON DELETE CASCADE,- "start_offset" INTEGER NOT NULL,- "end_offset" INTEGER NOT NULL,- "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,- PRIMARY KEY(message_id, start_offset)-);---- We use 'on conflict update' with this index, so it should be per-user.-CREATE UNIQUE INDEX "index_channel_messages_on_sender_id_nonce" ON "channel_messages" ("sender_id", "nonce");-DROP INDEX "index_channel_messages_on_nonce";diff --git a/crates/collab/migrations/20231024085546_move_channel_paths_to_channels_table.sql b/crates/collab/migrations/20231024085546_move_channel_paths_to_channels_table.sqldeleted file mode 100644index d9fc6c87226..00000000000--- a/crates/collab/migrations/20231024085546_move_channel_paths_to_channels_table.sql+++ /dev/null@@ -1,12 +0,0 @@-ALTER TABLE channels ADD COLUMN parent_path TEXT;--UPDATE channels-SET parent_path = substr(- channel_paths.id_path,- 2,- length(channel_paths.id_path) - length('/' || channel_paths.channel_id::text || '/')-)-FROM channel_paths-WHERE channel_paths.channel_id = channels.id;--CREATE INDEX "index_channels_on_parent_path" ON "channels" ("parent_path");diff --git a/crates/collab/migrations/20240103025509_add_role_to_room_participants.sql b/crates/collab/migrations/20240103025509_add_role_to_room_participants.sqldeleted file mode 100644index 2748e00ebaa..00000000000--- a/crates/collab/migrations/20240103025509_add_role_to_room_participants.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE room_participants ADD COLUMN role TEXT;diff --git a/crates/collab/migrations/20240111085546_fix_column_name.sql b/crates/collab/migrations/20240111085546_fix_column_name.sqldeleted file mode 100644index 3f32ee35c59..00000000000--- a/crates/collab/migrations/20240111085546_fix_column_name.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE rooms ADD COLUMN environment TEXT;diff --git a/crates/collab/migrations/20240117150300_add_impersonator_to_access_tokens.sql b/crates/collab/migrations/20240117150300_add_impersonator_to_access_tokens.sqldeleted file mode 100644index 8c79640cd88..00000000000--- a/crates/collab/migrations/20240117150300_add_impersonator_to_access_tokens.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE access_tokens ADD COLUMN impersonated_user_id integer;diff --git a/crates/collab/migrations/20240122174606_add_contributors.sql b/crates/collab/migrations/20240122174606_add_contributors.sqldeleted file mode 100644index 16bec82d4f2..00000000000--- a/crates/collab/migrations/20240122174606_add_contributors.sql+++ /dev/null@@ -1,5 +0,0 @@-CREATE TABLE contributors (- user_id INTEGER REFERENCES users(id),- signed_at TIMESTAMP NOT NULL DEFAULT NOW(),- PRIMARY KEY (user_id)-);diff --git a/crates/collab/migrations/20240122224506_add_requires_zed_cla_column_to_channels.sql b/crates/collab/migrations/20240122224506_add_requires_zed_cla_column_to_channels.sqldeleted file mode 100644index a9248d294a2..00000000000--- a/crates/collab/migrations/20240122224506_add_requires_zed_cla_column_to_channels.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE "channels" ADD COLUMN "requires_zed_cla" BOOLEAN NOT NULL DEFAULT FALSE;diff --git a/crates/collab/migrations/20240129193601_fix_parent_path_index.sql b/crates/collab/migrations/20240129193601_fix_parent_path_index.sqldeleted file mode 100644index 73dd6e37cdf..00000000000--- a/crates/collab/migrations/20240129193601_fix_parent_path_index.sql+++ /dev/null@@ -1,4 +0,0 @@--- Add migration script here--DROP INDEX index_channels_on_parent_path;-CREATE INDEX index_channels_on_parent_path ON channels (parent_path text_pattern_ops);diff --git a/crates/collab/migrations/20240203113741_add_reply_to_message.sql b/crates/collab/migrations/20240203113741_add_reply_to_message.sqldeleted file mode 100644index 6f40b62822b..00000000000--- a/crates/collab/migrations/20240203113741_add_reply_to_message.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE channel_messages ADD reply_to_message_id INTEGER DEFAULT NULLdiff --git a/crates/collab/migrations/20240207041417_add_in_call_column_to_room_participants.sql b/crates/collab/migrations/20240207041417_add_in_call_column_to_room_participants.sqldeleted file mode 100644index 09463c6e784..00000000000--- a/crates/collab/migrations/20240207041417_add_in_call_column_to_room_participants.sql+++ /dev/null@@ -1,3 +0,0 @@--- Add migration script here--ALTER TABLE room_participants ADD COLUMN in_call BOOL NOT NULL DEFAULT FALSE;diff --git a/crates/collab/migrations/20240213200201_remove_unused_room_columns.sql b/crates/collab/migrations/20240213200201_remove_unused_room_columns.sqldeleted file mode 100644index dc4897af48a..00000000000--- a/crates/collab/migrations/20240213200201_remove_unused_room_columns.sql+++ /dev/null@@ -1,4 +0,0 @@--- Add migration script here-ALTER TABLE rooms DROP COLUMN enviroment;-ALTER TABLE rooms DROP COLUMN environment;-ALTER TABLE room_participants DROP COLUMN in_call;diff --git a/crates/collab/migrations/20240214102900_add_extensions.sql b/crates/collab/migrations/20240214102900_add_extensions.sqldeleted file mode 100644index b32094036d6..00000000000--- a/crates/collab/migrations/20240214102900_add_extensions.sql+++ /dev/null@@ -1,22 +0,0 @@-CREATE TABLE IF NOT EXISTS extensions (- id SERIAL PRIMARY KEY,- name TEXT NOT NULL,- external_id TEXT NOT NULL,- latest_version TEXT NOT NULL,- total_download_count BIGINT NOT NULL DEFAULT 0-);--CREATE TABLE IF NOT EXISTS extension_versions (- extension_id INTEGER REFERENCES extensions(id),- version TEXT NOT NULL,- published_at TIMESTAMP NOT NULL DEFAULT now(),- authors TEXT NOT NULL,- repository TEXT NOT NULL,- description TEXT NOT NULL,- download_count BIGINT NOT NULL DEFAULT 0,- PRIMARY KEY(extension_id, version)-);--CREATE UNIQUE INDEX "index_extensions_external_id" ON "extensions" ("external_id");-CREATE INDEX "trigram_index_extensions_name" ON "extensions" USING GIN(name gin_trgm_ops);-CREATE INDEX "index_extensions_total_download_count" ON "extensions" ("total_download_count");diff --git a/crates/collab/migrations/20240220234826_add_rate_buckets.sql b/crates/collab/migrations/20240220234826_add_rate_buckets.sqldeleted file mode 100644index 864a4373034..00000000000--- a/crates/collab/migrations/20240220234826_add_rate_buckets.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE IF NOT EXISTS rate_buckets (- user_id INT NOT NULL,- rate_limit_name VARCHAR(255) NOT NULL,- token_count INT NOT NULL,- last_refill TIMESTAMP WITHOUT TIME ZONE NOT NULL,- PRIMARY KEY (user_id, rate_limit_name),- CONSTRAINT fk_user- FOREIGN KEY (user_id) REFERENCES users(id)-);--CREATE INDEX idx_user_id_rate_limit ON rate_buckets (user_id, rate_limit_name);diff --git a/crates/collab/migrations/20240221151017_add_edited_at_field_to_channel_message.sql b/crates/collab/migrations/20240221151017_add_edited_at_field_to_channel_message.sqldeleted file mode 100644index 1d07b07de7b..00000000000--- a/crates/collab/migrations/20240221151017_add_edited_at_field_to_channel_message.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE channel_messages ADD edited_at TIMESTAMP DEFAULT NULL;diff --git a/crates/collab/migrations/20240226163408_hosted_projects.sql b/crates/collab/migrations/20240226163408_hosted_projects.sqldeleted file mode 100644index c6ade7161cc..00000000000--- a/crates/collab/migrations/20240226163408_hosted_projects.sql+++ /dev/null@@ -1,11 +0,0 @@--- Add migration script here--CREATE TABLE hosted_projects (- id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,- channel_id INT NOT NULL REFERENCES channels(id),- name TEXT NOT NULL,- visibility TEXT NOT NULL,- deleted_at TIMESTAMP NULL-);-CREATE INDEX idx_hosted_projects_on_channel_id ON hosted_projects (channel_id);-CREATE UNIQUE INDEX uix_hosted_projects_on_channel_id_and_name ON hosted_projects (channel_id, name) WHERE (deleted_at IS NULL);diff --git a/crates/collab/migrations/20240226164505_unique_channel_names.sql b/crates/collab/migrations/20240226164505_unique_channel_names.sqldeleted file mode 100644index c9d9f0a1cbf..00000000000--- a/crates/collab/migrations/20240226164505_unique_channel_names.sql+++ /dev/null@@ -1,3 +0,0 @@--- Add migration script here--CREATE UNIQUE INDEX uix_channels_parent_path_name ON channels(parent_path, name) WHERE (parent_path IS NOT NULL AND parent_path != '');diff --git a/crates/collab/migrations/20240227215556_hosted_projects_in_projects.sql b/crates/collab/migrations/20240227215556_hosted_projects_in_projects.sqldeleted file mode 100644index 69905d12f6d..00000000000--- a/crates/collab/migrations/20240227215556_hosted_projects_in_projects.sql+++ /dev/null@@ -1,3 +0,0 @@--- Add migration script here-ALTER TABLE projects ALTER COLUMN host_user_id DROP NOT NULL;-ALTER TABLE projects ADD COLUMN hosted_project_id INTEGER REFERENCES hosted_projects(id) UNIQUE NULL;diff --git a/crates/collab/migrations/20240307163119_denormalize_buffer_ops.sql b/crates/collab/migrations/20240307163119_denormalize_buffer_ops.sqldeleted file mode 100644index a332a20d52c..00000000000--- a/crates/collab/migrations/20240307163119_denormalize_buffer_ops.sql+++ /dev/null@@ -1,17 +0,0 @@--- Add migration script here--ALTER TABLE buffers ADD COLUMN latest_operation_epoch INTEGER;-ALTER TABLE buffers ADD COLUMN latest_operation_lamport_timestamp INTEGER;-ALTER TABLE buffers ADD COLUMN latest_operation_replica_id INTEGER;--WITH ops AS (- SELECT DISTINCT ON (buffer_id) buffer_id, epoch, lamport_timestamp, replica_id- FROM buffer_operations- ORDER BY buffer_id, epoch DESC, lamport_timestamp DESC, replica_id DESC-)-UPDATE buffers-SET latest_operation_epoch = ops.epoch,- latest_operation_lamport_timestamp = ops.lamport_timestamp,- latest_operation_replica_id = ops.replica_id-FROM ops-WHERE buffers.id = ops.buffer_id;diff --git a/crates/collab/migrations/20240315182903_non_null_channel_role.sql b/crates/collab/migrations/20240315182903_non_null_channel_role.sqldeleted file mode 100644index 2d359f8058f..00000000000--- a/crates/collab/migrations/20240315182903_non_null_channel_role.sql+++ /dev/null@@ -1,4 +0,0 @@--- Add migration script here--ALTER TABLE channel_members ALTER role SET NOT NULL;-ALTER TABLE channel_members DROP COLUMN admin;diff --git a/crates/collab/migrations/20240315183903_channel_parent_path_not_null.sql b/crates/collab/migrations/20240315183903_channel_parent_path_not_null.sqldeleted file mode 100644index 5703578b008..00000000000--- a/crates/collab/migrations/20240315183903_channel_parent_path_not_null.sql+++ /dev/null@@ -1,2 +0,0 @@--- Add migration script here-ALTER TABLE channels ALTER parent_path SET NOT NULL;diff --git a/crates/collab/migrations/20240320124800_add_extension_schema_version.sql b/crates/collab/migrations/20240320124800_add_extension_schema_version.sqldeleted file mode 100644index 75fd0f40e4f..00000000000--- a/crates/collab/migrations/20240320124800_add_extension_schema_version.sql+++ /dev/null@@ -1,2 +0,0 @@--- Add migration script here-ALTER TABLE extension_versions ADD COLUMN schema_version INTEGER NOT NULL DEFAULT 0;diff --git a/crates/collab/migrations/20240321162658_add_devservers.sql b/crates/collab/migrations/20240321162658_add_devservers.sqldeleted file mode 100644index cb1ff4df405..00000000000--- a/crates/collab/migrations/20240321162658_add_devservers.sql+++ /dev/null@@ -1,7 +0,0 @@-CREATE TABLE dev_servers (- id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,- channel_id INT NOT NULL REFERENCES channels(id),- name TEXT NOT NULL,- hashed_token TEXT NOT NULL-);-CREATE INDEX idx_dev_servers_on_channel_id ON dev_servers (channel_id);diff --git a/crates/collab/migrations/20240335123500_add_extension_wasm_api_version.sql b/crates/collab/migrations/20240335123500_add_extension_wasm_api_version.sqldeleted file mode 100644index 3b95323d262..00000000000--- a/crates/collab/migrations/20240335123500_add_extension_wasm_api_version.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE extension_versions ADD COLUMN wasm_api_version TEXT;diff --git a/crates/collab/migrations/20240402155003_add_dev_server_projects.sql b/crates/collab/migrations/20240402155003_add_dev_server_projects.sqldeleted file mode 100644index 003c43f4e27..00000000000--- a/crates/collab/migrations/20240402155003_add_dev_server_projects.sql+++ /dev/null@@ -1,9 +0,0 @@-CREATE TABLE remote_projects (- id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,- channel_id INT NOT NULL REFERENCES channels(id),- dev_server_id INT NOT NULL REFERENCES dev_servers(id),- name TEXT NOT NULL,- path TEXT NOT NULL-);--ALTER TABLE projects ADD COLUMN remote_project_id INTEGER REFERENCES remote_projects(id);diff --git a/crates/collab/migrations/20240409082755_create_embeddings.sql b/crates/collab/migrations/20240409082755_create_embeddings.sqldeleted file mode 100644index ae4b4bcb61c..00000000000--- a/crates/collab/migrations/20240409082755_create_embeddings.sql+++ /dev/null@@ -1,9 +0,0 @@-CREATE TABLE IF NOT EXISTS "embeddings" (- "model" TEXT,- "digest" BYTEA,- "dimensions" FLOAT4[1536],- "retrieved_at" TIMESTAMP NOT NULL DEFAULT now(),- PRIMARY KEY ("model", "digest")-);--CREATE INDEX IF NOT EXISTS "idx_retrieved_at_on_embeddings" ON "embeddings" ("retrieved_at");diff --git a/crates/collab/migrations/20240412165156_dev_servers_per_user.sql b/crates/collab/migrations/20240412165156_dev_servers_per_user.sqldeleted file mode 100644index 7ef9e2fde05..00000000000--- a/crates/collab/migrations/20240412165156_dev_servers_per_user.sql+++ /dev/null@@ -1,7 +0,0 @@-DELETE FROM remote_projects;-DELETE FROM dev_servers;--ALTER TABLE dev_servers DROP COLUMN channel_id;-ALTER TABLE dev_servers ADD COLUMN user_id INT NOT NULL REFERENCES users(id);--ALTER TABLE remote_projects DROP COLUMN channel_id;diff --git a/crates/collab/migrations/20240417192746_unique_remote_projects_by_paths.sql b/crates/collab/migrations/20240417192746_unique_remote_projects_by_paths.sqldeleted file mode 100644index 923b948ceeb..00000000000--- a/crates/collab/migrations/20240417192746_unique_remote_projects_by_paths.sql+++ /dev/null@@ -1,3 +0,0 @@-ALTER TABLE remote_projects DROP COLUMN name;-ALTER TABLE remote_projects-ADD CONSTRAINT unique_path_constraint UNIQUE(dev_server_id, path);diff --git a/crates/collab/migrations/20240502150229_rename_to_dev_server_projects.sql b/crates/collab/migrations/20240502150229_rename_to_dev_server_projects.sqldeleted file mode 100644index 0d8e9de5e6a..00000000000--- a/crates/collab/migrations/20240502150229_rename_to_dev_server_projects.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE dev_server_projects (- id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 100),- dev_server_id INT NOT NULL REFERENCES dev_servers(id) ON DELETE CASCADE,- path TEXT NOT NULL-);-INSERT INTO dev_server_projects OVERRIDING SYSTEM VALUE SELECT * FROM remote_projects;--ALTER TABLE dev_server_projects ADD CONSTRAINT uix_dev_server_projects_dev_server_id_path UNIQUE(dev_server_id, path);--ALTER TABLE projects ADD COLUMN dev_server_project_id INTEGER REFERENCES dev_server_projects(id);-UPDATE projects SET dev_server_project_id = remote_project_id;diff --git a/crates/collab/migrations/20240502180204_remove_old_remote_projects.sql b/crates/collab/migrations/20240502180204_remove_old_remote_projects.sqldeleted file mode 100644index 01ace43fab0..00000000000--- a/crates/collab/migrations/20240502180204_remove_old_remote_projects.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE projects DROP COLUMN remote_project_id;-DROP TABLE remote_projects;diff --git a/crates/collab/migrations/20240514164510_store_ssh_connect_string.sql b/crates/collab/migrations/20240514164510_store_ssh_connect_string.sqldeleted file mode 100644index 5085ca271bd..00000000000--- a/crates/collab/migrations/20240514164510_store_ssh_connect_string.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE dev_servers ADD COLUMN ssh_connection_string TEXT;diff --git a/crates/collab/migrations/20240715230940_add_worktrees_to_dev_server_projects.sql b/crates/collab/migrations/20240715230940_add_worktrees_to_dev_server_projects.sqldeleted file mode 100644index 675df4885bb..00000000000--- a/crates/collab/migrations/20240715230940_add_worktrees_to_dev_server_projects.sql+++ /dev/null@@ -1,4 +0,0 @@-ALTER TABLE dev_server_projects ADD COLUMN paths JSONB NULL;-UPDATE dev_server_projects SET paths = to_json(ARRAY[path]);-ALTER TABLE dev_server_projects ALTER COLUMN paths SET NOT NULL;-ALTER TABLE dev_server_projects ALTER COLUMN path DROP NOT NULL;diff --git a/crates/collab/migrations/20240729170526_add_billing_subscription.sql b/crates/collab/migrations/20240729170526_add_billing_subscription.sqldeleted file mode 100644index acec4b3ddb4..00000000000--- a/crates/collab/migrations/20240729170526_add_billing_subscription.sql+++ /dev/null@@ -1,12 +0,0 @@-CREATE TABLE IF NOT EXISTS billing_subscriptions (- id SERIAL PRIMARY KEY,- created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now(),- user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,- stripe_customer_id TEXT NOT NULL,- stripe_subscription_id TEXT NOT NULL,- stripe_subscription_status TEXT NOT NULL-);--CREATE INDEX "ix_billing_subscriptions_on_user_id" ON billing_subscriptions (user_id);-CREATE INDEX "ix_billing_subscriptions_on_stripe_customer_id" ON billing_subscriptions (stripe_customer_id);-CREATE UNIQUE INDEX "uix_billing_subscriptions_on_stripe_subscription_id" ON billing_subscriptions (stripe_subscription_id);diff --git a/crates/collab/migrations/20240730014107_add_billing_customer.sql b/crates/collab/migrations/20240730014107_add_billing_customer.sqldeleted file mode 100644index 7f7d4a0f856..00000000000--- a/crates/collab/migrations/20240730014107_add_billing_customer.sql+++ /dev/null@@ -1,18 +0,0 @@-CREATE TABLE IF NOT EXISTS billing_customers (- id SERIAL PRIMARY KEY,- created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now(),- user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,- stripe_customer_id TEXT NOT NULL-);--CREATE UNIQUE INDEX "uix_billing_customers_on_user_id" ON billing_customers (user_id);-CREATE UNIQUE INDEX "uix_billing_customers_on_stripe_customer_id" ON billing_customers (stripe_customer_id);---- Make `billing_subscriptions` reference `billing_customers` instead of having its--- own `user_id` and `stripe_customer_id`.-DROP INDEX IF EXISTS "ix_billing_subscriptions_on_user_id";-DROP INDEX IF EXISTS "ix_billing_subscriptions_on_stripe_customer_id";-ALTER TABLE billing_subscriptions DROP COLUMN user_id;-ALTER TABLE billing_subscriptions DROP COLUMN stripe_customer_id;-ALTER TABLE billing_subscriptions ADD COLUMN billing_customer_id INTEGER NOT NULL REFERENCES billing_customers (id) ON DELETE CASCADE;-CREATE INDEX "ix_billing_subscriptions_on_billing_customer_id" ON billing_subscriptions (billing_customer_id);diff --git a/crates/collab/migrations/20240730122654_add_last_stripe_event_id.sql b/crates/collab/migrations/20240730122654_add_last_stripe_event_id.sqldeleted file mode 100644index 477eadd742e..00000000000--- a/crates/collab/migrations/20240730122654_add_last_stripe_event_id.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE billing_customers ADD COLUMN last_stripe_event_id TEXT;-ALTER TABLE billing_subscriptions ADD COLUMN last_stripe_event_id TEXT;diff --git a/crates/collab/migrations/20240730182554_add_processed_stripe_events.sql b/crates/collab/migrations/20240730182554_add_processed_stripe_events.sqldeleted file mode 100644index baf1aa3122e..00000000000--- a/crates/collab/migrations/20240730182554_add_processed_stripe_events.sql+++ /dev/null@@ -1,11 +0,0 @@-ALTER TABLE billing_customers DROP COLUMN last_stripe_event_id;-ALTER TABLE billing_subscriptions DROP COLUMN last_stripe_event_id;--CREATE TABLE IF NOT EXISTS processed_stripe_events (- stripe_event_id TEXT PRIMARY KEY,- stripe_event_type TEXT NOT NULL,- stripe_event_created_timestamp BIGINT NOT NULL,- processed_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT now()-);--CREATE INDEX "ix_processed_stripe_events_on_stripe_event_created_timestamp" ON processed_stripe_events (stripe_event_created_timestamp);diff --git a/crates/collab/migrations/20240731120800_add_stripe_cancel_at_to_billing_subscriptions.sql b/crates/collab/migrations/20240731120800_add_stripe_cancel_at_to_billing_subscriptions.sqldeleted file mode 100644index b09640bb1ea..00000000000--- a/crates/collab/migrations/20240731120800_add_stripe_cancel_at_to_billing_subscriptions.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE billing_subscriptions ADD COLUMN stripe_cancel_at TIMESTAMP WITHOUT TIME ZONE;diff --git a/crates/collab/migrations/20240812073542_add_accepted_tos_at.sql b/crates/collab/migrations/20240812073542_add_accepted_tos_at.sqldeleted file mode 100644index 43fa0e7bbdc..00000000000--- a/crates/collab/migrations/20240812073542_add_accepted_tos_at.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE users ADD accepted_tos_at TIMESTAMP WITHOUT TIME ZONE;diff --git a/crates/collab/migrations/20240812204045_add_github_user_created_at_to_users.sql b/crates/collab/migrations/20240812204045_add_github_user_created_at_to_users.sqldeleted file mode 100644index a5f713ef7c4..00000000000--- a/crates/collab/migrations/20240812204045_add_github_user_created_at_to_users.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE "users" ADD COLUMN "github_user_created_at" TIMESTAMP WITHOUT TIME ZONE;diff --git a/crates/collab/migrations/20240816181658_add_enabled_for_all_to_feature_flags.sql b/crates/collab/migrations/20240816181658_add_enabled_for_all_to_feature_flags.sqldeleted file mode 100644index a56c87b97a4..00000000000--- a/crates/collab/migrations/20240816181658_add_enabled_for_all_to_feature_flags.sql+++ /dev/null@@ -1 +0,0 @@-alter table feature_flags add column enabled_for_all boolean not null default false;diff --git a/crates/collab/migrations/20240822215737_add_unique_constraint_on_github_user_id_on_users.sql b/crates/collab/migrations/20240822215737_add_unique_constraint_on_github_user_id_on_users.sqldeleted file mode 100644index 3b418f7e266..00000000000--- a/crates/collab/migrations/20240822215737_add_unique_constraint_on_github_user_id_on_users.sql+++ /dev/null@@ -1,4 +0,0 @@-alter table users alter column github_user_id set not null;--drop index index_users_on_github_user_id;-create unique index uix_users_on_github_user_id on users (github_user_id);diff --git a/crates/collab/migrations/20240823155956_add_is_fifo_to_worktree_entries.sql b/crates/collab/migrations/20240823155956_add_is_fifo_to_worktree_entries.sqldeleted file mode 100644index af6fdac19d2..00000000000--- a/crates/collab/migrations/20240823155956_add_is_fifo_to_worktree_entries.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "worktree_entries"-ADD "is_fifo" BOOL NOT NULL DEFAULT FALSE;diff --git a/crates/collab/migrations/20241002120231_add_local_settings_kind.sql b/crates/collab/migrations/20241002120231_add_local_settings_kind.sqldeleted file mode 100644index aec4ffb8f85..00000000000--- a/crates/collab/migrations/20241002120231_add_local_settings_kind.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE "worktree_settings_files" ADD COLUMN "kind" VARCHAR;diff --git a/crates/collab/migrations/20241009190639_add_billing_preferences.sql b/crates/collab/migrations/20241009190639_add_billing_preferences.sqldeleted file mode 100644index 9aa5a1a3036..00000000000--- a/crates/collab/migrations/20241009190639_add_billing_preferences.sql+++ /dev/null@@ -1,8 +0,0 @@-create table if not exists billing_preferences (- id serial primary key,- created_at timestamp without time zone not null default now(),- user_id integer not null references users(id) on delete cascade,- max_monthly_llm_usage_spending_in_cents integer not null-);--create unique index "uix_billing_preferences_on_user_id" on billing_preferences (user_id);diff --git a/crates/collab/migrations/20241019184824_adjust_symlink_data.sql b/crates/collab/migrations/20241019184824_adjust_symlink_data.sqldeleted file mode 100644index a38dd21cde8..00000000000--- a/crates/collab/migrations/20241019184824_adjust_symlink_data.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE worktree_entries ADD COLUMN canonical_path text;-ALTER TABLE worktree_entries ALTER COLUMN is_symlink SET DEFAULT false;diff --git a/crates/collab/migrations/20241021202606_add_custom_llm_monthly_allowance_in_cents_to_users.sql b/crates/collab/migrations/20241021202606_add_custom_llm_monthly_allowance_in_cents_to_users.sqldeleted file mode 100644index 60a9bfa9107..00000000000--- a/crates/collab/migrations/20241021202606_add_custom_llm_monthly_allowance_in_cents_to_users.sql+++ /dev/null@@ -1 +0,0 @@-alter table users add column custom_llm_monthly_allowance_in_cents integer;diff --git a/crates/collab/migrations/20241023201725_remove_dev_servers.sql b/crates/collab/migrations/20241023201725_remove_dev_servers.sqldeleted file mode 100644index c5da673a29b..00000000000--- a/crates/collab/migrations/20241023201725_remove_dev_servers.sql+++ /dev/null@@ -1,6 +0,0 @@-ALTER TABLE projects DROP COLUMN dev_server_project_id;-ALTER TABLE projects DROP COLUMN hosted_project_id;--DROP TABLE hosted_projects;-DROP TABLE dev_server_projects;-DROP TABLE dev_servers;diff --git a/crates/collab/migrations/20241121185750_add_breakpoints.sql b/crates/collab/migrations/20241121185750_add_breakpoints.sqldeleted file mode 100644index 4b307145739..00000000000--- a/crates/collab/migrations/20241121185750_add_breakpoints.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE IF NOT EXISTS "breakpoints" (- "id" SERIAL PRIMARY KEY,- "project_id" INTEGER NOT NULL REFERENCES projects (id) ON DELETE CASCADE,- "position" INTEGER NOT NULL,- "log_message" TEXT NULL,- "worktree_id" BIGINT NOT NULL,- "path" TEXT NOT NULL,- "kind" VARCHAR NOT NULL-);--CREATE INDEX "index_breakpoints_on_project_id" ON "breakpoints" ("project_id");diff --git a/crates/collab/migrations/20250108184547_add_stripe_cancellation_reason_to_billing_subscriptions.sql b/crates/collab/migrations/20250108184547_add_stripe_cancellation_reason_to_billing_subscriptions.sqldeleted file mode 100644index 31686f56bbc..00000000000--- a/crates/collab/migrations/20250108184547_add_stripe_cancellation_reason_to_billing_subscriptions.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_subscriptions-add column stripe_cancellation_reason text;diff --git a/crates/collab/migrations/20250113230049_expand_git_status_information.sql b/crates/collab/migrations/20250113230049_expand_git_status_information.sqldeleted file mode 100644index eada39fe304..00000000000--- a/crates/collab/migrations/20250113230049_expand_git_status_information.sql+++ /dev/null@@ -1,13 +0,0 @@-ALTER TABLE worktree_repository_statuses-ADD COLUMN status_kind INTEGER,-ADD COLUMN first_status INTEGER,-ADD COLUMN second_status INTEGER;--UPDATE worktree_repository_statuses-SET- status_kind = 0;--ALTER TABLE worktree_repository_statuses-ALTER COLUMN status_kind-SET- NOT NULL;diff --git a/crates/collab/migrations/20250117100620_add_user_name.sql b/crates/collab/migrations/20250117100620_add_user_name.sqldeleted file mode 100644index fff7f95b605..00000000000--- a/crates/collab/migrations/20250117100620_add_user_name.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE users ADD COLUMN name TEXT;diff --git a/crates/collab/migrations/20250204224004_add_has_overdue_invoices_to_billing_customers.sql b/crates/collab/migrations/20250204224004_add_has_overdue_invoices_to_billing_customers.sqldeleted file mode 100644index 07c40303994..00000000000--- a/crates/collab/migrations/20250204224004_add_has_overdue_invoices_to_billing_customers.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_customers-add column has_overdue_invoices bool not null default false;diff --git a/crates/collab/migrations/20250205192813_add_provides_fields_to_extension_versions.sql b/crates/collab/migrations/20250205192813_add_provides_fields_to_extension_versions.sqldeleted file mode 100644index 50dcb0508f3..00000000000--- a/crates/collab/migrations/20250205192813_add_provides_fields_to_extension_versions.sql+++ /dev/null@@ -1,10 +0,0 @@-alter table extension_versions-add column provides_themes bool not null default false,-add column provides_icon_themes bool not null default false,-add column provides_languages bool not null default false,-add column provides_grammars bool not null default false,-add column provides_language_servers bool not null default false,-add column provides_context_servers bool not null default false,-add column provides_slash_commands bool not null default false,-add column provides_indexed_docs_providers bool not null default false,-add column provides_snippets bool not null default false;diff --git a/crates/collab/migrations/20250205232017_add_conflicts_to_repositories.sql b/crates/collab/migrations/20250205232017_add_conflicts_to_repositories.sqldeleted file mode 100644index e6e0770bba8..00000000000--- a/crates/collab/migrations/20250205232017_add_conflicts_to_repositories.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE worktree_repositories-ADD COLUMN current_merge_conflicts VARCHAR NULL;diff --git a/crates/collab/migrations/20250210223746_add_branch_summary.sql b/crates/collab/migrations/20250210223746_add_branch_summary.sqldeleted file mode 100644index 3294f38b941..00000000000--- a/crates/collab/migrations/20250210223746_add_branch_summary.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE worktree_repositories-ADD COLUMN worktree_repositories VARCHAR NULL;diff --git a/crates/collab/migrations/20250212060936_add_worktree_branch_summary.sql b/crates/collab/migrations/20250212060936_add_worktree_branch_summary.sqldeleted file mode 100644index d7e3c04e2ff..00000000000--- a/crates/collab/migrations/20250212060936_add_worktree_branch_summary.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE worktree_repositories ADD COLUMN branch_summary TEXT NULL;diff --git a/crates/collab/migrations/20250319182812_create_project_repositories.sql b/crates/collab/migrations/20250319182812_create_project_repositories.sqldeleted file mode 100644index 8ca8c3444e6..00000000000--- a/crates/collab/migrations/20250319182812_create_project_repositories.sql+++ /dev/null@@ -1,32 +0,0 @@-CREATE TABLE "project_repositories" (- "project_id" INTEGER NOT NULL,- "abs_path" VARCHAR,- "id" INT8 NOT NULL,- "legacy_worktree_id" INT8,- "entry_ids" VARCHAR,- "branch" VARCHAR,- "scan_id" INT8 NOT NULL,- "is_deleted" BOOL NOT NULL,- "current_merge_conflicts" VARCHAR,- "branch_summary" VARCHAR,- PRIMARY KEY (project_id, id)-);--CREATE INDEX "index_project_repositories_on_project_id" ON "project_repositories" ("project_id");--CREATE TABLE "project_repository_statuses" (- "project_id" INTEGER NOT NULL,- "repository_id" INT8 NOT NULL,- "repo_path" VARCHAR NOT NULL,- "status" INT8 NOT NULL,- "status_kind" INT4 NOT NULL,- "first_status" INT4 NULL,- "second_status" INT4 NULL,- "scan_id" INT8 NOT NULL,- "is_deleted" BOOL NOT NULL,- PRIMARY KEY (project_id, repository_id, repo_path)-);--CREATE INDEX "index_project_repos_statuses_on_project_id" ON "project_repository_statuses" ("project_id");--CREATE INDEX "index_project_repos_statuses_on_project_id_and_repo_id" ON "project_repository_statuses" ("project_id", "repository_id");diff --git a/crates/collab/migrations/20250415164141_add_kind_and_period_to_billing_subscriptions.sql b/crates/collab/migrations/20250415164141_add_kind_and_period_to_billing_subscriptions.sqldeleted file mode 100644index b91431b28ba..00000000000--- a/crates/collab/migrations/20250415164141_add_kind_and_period_to_billing_subscriptions.sql+++ /dev/null@@ -1,4 +0,0 @@-alter table billing_subscriptions- add column kind text,- add column stripe_current_period_start bigint,- add column stripe_current_period_end bigint;diff --git a/crates/collab/migrations/20250422194500_add_trial_started_at_to_billing_customers.sql b/crates/collab/migrations/20250422194500_add_trial_started_at_to_billing_customers.sqldeleted file mode 100644index 34a159cf65a..00000000000--- a/crates/collab/migrations/20250422194500_add_trial_started_at_to_billing_customers.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_customers- add column trial_started_at timestamp without time zone;diff --git a/crates/collab/migrations/20250423150129_add_head_commit_details_to_project_repositories.sql b/crates/collab/migrations/20250423150129_add_head_commit_details_to_project_repositories.sqldeleted file mode 100644index c37fed22422..00000000000--- a/crates/collab/migrations/20250423150129_add_head_commit_details_to_project_repositories.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table project_repositories- add column head_commit_details varchar;diff --git a/crates/collab/migrations/20250425201930_add_model_request_overages_to_billing_preferences.sql b/crates/collab/migrations/20250425201930_add_model_request_overages_to_billing_preferences.sqldeleted file mode 100644index 86e35c9202b..00000000000--- a/crates/collab/migrations/20250425201930_add_model_request_overages_to_billing_preferences.sql+++ /dev/null@@ -1,3 +0,0 @@-alter table billing_preferences- add column model_request_overages_enabled bool not null default false,- add column model_request_overages_spend_limit_in_cents integer not null default 0;diff --git a/crates/collab/migrations/20250530175450_add_channel_order.sql b/crates/collab/migrations/20250530175450_add_channel_order.sqldeleted file mode 100644index 977a4611cdb..00000000000--- a/crates/collab/migrations/20250530175450_add_channel_order.sql+++ /dev/null@@ -1,16 +0,0 @@--- Add channel_order column to channels table with default value-ALTER TABLE channels ADD COLUMN channel_order INTEGER NOT NULL DEFAULT 1;---- Update channel_order for existing channels using ROW_NUMBER for deterministic ordering-UPDATE channels-SET channel_order = (- SELECT ROW_NUMBER() OVER (- PARTITION BY parent_path- ORDER BY name, id- )- FROM channels c2- WHERE c2.id = channels.id-);---- Create index for efficient ordering queries-CREATE INDEX "index_channels_on_parent_path_and_order" ON "channels" ("parent_path", "channel_order");diff --git a/crates/collab/migrations/20250612153105_add_collaborator_commit_email.sql b/crates/collab/migrations/20250612153105_add_collaborator_commit_email.sqldeleted file mode 100644index 73876e89652..00000000000--- a/crates/collab/migrations/20250612153105_add_collaborator_commit_email.sql+++ /dev/null@@ -1,4 +0,0 @@-alter table project_collaborators- add column committer_name varchar;-alter table project_collaborators- add column committer_email varchar;diff --git a/crates/collab/migrations/20250617082236_add_debug_adapter_provides_field_to_extensions.sql b/crates/collab/migrations/20250617082236_add_debug_adapter_provides_field_to_extensions.sqldeleted file mode 100644index 8455a82f9ee..00000000000--- a/crates/collab/migrations/20250617082236_add_debug_adapter_provides_field_to_extensions.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table extension_versions-add column provides_debug_adapters bool not null default falsediff --git a/crates/collab/migrations/20250618090000_add_agent_servers_provides_field_to_extensions.sql b/crates/collab/migrations/20250618090000_add_agent_servers_provides_field_to_extensions.sqldeleted file mode 100644index 3c399924b96..00000000000--- a/crates/collab/migrations/20250618090000_add_agent_servers_provides_field_to_extensions.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table extension_versions-add column provides_agent_servers bool not null default falsediff --git a/crates/collab/migrations/20250702185129_add_cascading_delete_to_repository_entries.sql b/crates/collab/migrations/20250702185129_add_cascading_delete_to_repository_entries.sqldeleted file mode 100644index 6d898c48119..00000000000--- a/crates/collab/migrations/20250702185129_add_cascading_delete_to_repository_entries.sql+++ /dev/null@@ -1,25 +0,0 @@-DELETE FROM project_repositories-WHERE project_id NOT IN (SELECT id FROM projects);--ALTER TABLE project_repositories- ADD CONSTRAINT fk_project_repositories_project_id- FOREIGN KEY (project_id)- REFERENCES projects (id)- ON DELETE CASCADE- NOT VALID;--ALTER TABLE project_repositories- VALIDATE CONSTRAINT fk_project_repositories_project_id;--DELETE FROM project_repository_statuses-WHERE project_id NOT IN (SELECT id FROM projects);--ALTER TABLE project_repository_statuses- ADD CONSTRAINT fk_project_repository_statuses_project_id- FOREIGN KEY (project_id)- REFERENCES projects (id)- ON DELETE CASCADE- NOT VALID;--ALTER TABLE project_repository_statuses- VALIDATE CONSTRAINT fk_project_repository_statuses_project_id;diff --git a/crates/collab/migrations/20250707182700_add_access_tokens_cascade_delete_on_user.sql b/crates/collab/migrations/20250707182700_add_access_tokens_cascade_delete_on_user.sqldeleted file mode 100644index ae0ffe24f63..00000000000--- a/crates/collab/migrations/20250707182700_add_access_tokens_cascade_delete_on_user.sql+++ /dev/null@@ -1,3 +0,0 @@-ALTER TABLE access_tokens DROP CONSTRAINT access_tokens_user_id_fkey;-ALTER TABLE access_tokens ADD CONSTRAINT access_tokens_user_id_fkey- FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;diff --git a/crates/collab/migrations/20250804080620_language_server_capabilities.sql b/crates/collab/migrations/20250804080620_language_server_capabilities.sqldeleted file mode 100644index f74f094ed25..00000000000--- a/crates/collab/migrations/20250804080620_language_server_capabilities.sql+++ /dev/null@@ -1,5 +0,0 @@-ALTER TABLE language_servers- ADD COLUMN capabilities TEXT NOT NULL DEFAULT '{}';--ALTER TABLE language_servers- ALTER COLUMN capabilities DROP DEFAULT;diff --git a/crates/collab/migrations/20250816124707_make_admin_required_on_users.sql b/crates/collab/migrations/20250816124707_make_admin_required_on_users.sqldeleted file mode 100644index e372723d6d5..00000000000--- a/crates/collab/migrations/20250816124707_make_admin_required_on_users.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table users-alter column admin set not null;diff --git a/crates/collab/migrations/20250816133027_add_orb_customer_id_to_billing_customers.sql b/crates/collab/migrations/20250816133027_add_orb_customer_id_to_billing_customers.sqldeleted file mode 100644index ea5e4de52a8..00000000000--- a/crates/collab/migrations/20250816133027_add_orb_customer_id_to_billing_customers.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_customers- add column orb_customer_id text;diff --git a/crates/collab/migrations/20250816135346_drop_rate_buckets_table.sql b/crates/collab/migrations/20250816135346_drop_rate_buckets_table.sqldeleted file mode 100644index f51a33ed30d..00000000000--- a/crates/collab/migrations/20250816135346_drop_rate_buckets_table.sql+++ /dev/null@@ -1 +0,0 @@-drop table rate_buckets;diff --git a/crates/collab/migrations/20250818192156_add_git_merge_message.sql b/crates/collab/migrations/20250818192156_add_git_merge_message.sqldeleted file mode 100644index 335ea2f8249..00000000000--- a/crates/collab/migrations/20250818192156_add_git_merge_message.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE "project_repositories" ADD COLUMN "merge_message" VARCHAR;diff --git a/crates/collab/migrations/20250819022421_add_orb_subscription_id_to_billing_subscriptions.sql b/crates/collab/migrations/20250819022421_add_orb_subscription_id_to_billing_subscriptions.sqldeleted file mode 100644index 317f6a7653e..00000000000--- a/crates/collab/migrations/20250819022421_add_orb_subscription_id_to_billing_subscriptions.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_subscriptions- add column orb_subscription_id text;diff --git a/crates/collab/migrations/20250819225916_make_stripe_fields_optional_on_billing_subscription.sql b/crates/collab/migrations/20250819225916_make_stripe_fields_optional_on_billing_subscription.sqldeleted file mode 100644index cf3b79da60b..00000000000--- a/crates/collab/migrations/20250819225916_make_stripe_fields_optional_on_billing_subscription.sql+++ /dev/null@@ -1,3 +0,0 @@-alter table billing_subscriptions- alter column stripe_subscription_id drop not null,- alter column stripe_subscription_status drop not null;diff --git a/crates/collab/migrations/20250821133754_add_orb_subscription_status_and_period_to_billing_subscriptions.sql b/crates/collab/migrations/20250821133754_add_orb_subscription_status_and_period_to_billing_subscriptions.sqldeleted file mode 100644index 89a42ab82bd..00000000000--- a/crates/collab/migrations/20250821133754_add_orb_subscription_status_and_period_to_billing_subscriptions.sql+++ /dev/null@@ -1,4 +0,0 @@-alter table billing_subscriptions- add column orb_subscription_status text,- add column orb_current_billing_period_start_date timestamp without time zone,- add column orb_current_billing_period_end_date timestamp without time zone;diff --git a/crates/collab/migrations/20250827084812_worktree_in_servers.sql b/crates/collab/migrations/20250827084812_worktree_in_servers.sqldeleted file mode 100644index d4c6ffbbccc..00000000000--- a/crates/collab/migrations/20250827084812_worktree_in_servers.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE language_servers- ADD COLUMN worktree_id BIGINT;diff --git a/crates/collab/migrations/20250913035238_add_orb_cancellation_date_to_billing_subscriptions.sql b/crates/collab/migrations/20250913035238_add_orb_cancellation_date_to_billing_subscriptions.sqldeleted file mode 100644index 56144237421..00000000000--- a/crates/collab/migrations/20250913035238_add_orb_cancellation_date_to_billing_subscriptions.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_subscriptions- add column orb_cancellation_date timestamp without time zone;diff --git a/crates/collab/migrations/20250914022147_add_orb_portal_url_to_billing_customers.sql b/crates/collab/migrations/20250914022147_add_orb_portal_url_to_billing_customers.sqldeleted file mode 100644index 2de05740410..00000000000--- a/crates/collab/migrations/20250914022147_add_orb_portal_url_to_billing_customers.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table billing_customers- add column orb_portal_url text;diff --git a/crates/collab/migrations/20250916173002_add_path_style_to_project.sql b/crates/collab/migrations/20250916173002_add_path_style_to_project.sqldeleted file mode 100644index b1244818f14..00000000000--- a/crates/collab/migrations/20250916173002_add_path_style_to_project.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE projects ADD COLUMN windows_paths BOOLEAN DEFAULT FALSE;diff --git a/crates/collab/migrations/20251002214229_add_token_spend_in_cents_to_billing_subscriptions.sql b/crates/collab/migrations/20251002214229_add_token_spend_in_cents_to_billing_subscriptions.sqldeleted file mode 100644index ccae01e2833..00000000000--- a/crates/collab/migrations/20251002214229_add_token_spend_in_cents_to_billing_subscriptions.sql+++ /dev/null@@ -1,3 +0,0 @@-alter table billing_subscriptions- add column token_spend_in_cents integer,- add column token_spend_in_cents_updated_at timestamp without time zone;diff --git a/crates/collab/migrations/20251008120000_add_is_hidden_to_worktree_entries.sql b/crates/collab/migrations/20251008120000_add_is_hidden_to_worktree_entries.sqldeleted file mode 100644index 5b4207aeea5..00000000000--- a/crates/collab/migrations/20251008120000_add_is_hidden_to_worktree_entries.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "worktree_entries"-ADD "is_hidden" BOOL NOT NULL DEFAULT FALSE;diff --git a/crates/collab/migrations/20251110214057_drop_channel_messages.sql b/crates/collab/migrations/20251110214057_drop_channel_messages.sqldeleted file mode 100644index 468534542fb..00000000000--- a/crates/collab/migrations/20251110214057_drop_channel_messages.sql+++ /dev/null@@ -1,3 +0,0 @@-drop table observed_channel_messages;-drop table channel_message_mentions;-drop table channel_messages;diff --git a/crates/collab/migrations/20251111161644_drop_embeddings.sql b/crates/collab/migrations/20251111161644_drop_embeddings.sqldeleted file mode 100644index 80f42c7d2c8..00000000000--- a/crates/collab/migrations/20251111161644_drop_embeddings.sql+++ /dev/null@@ -1 +0,0 @@-drop table embeddings;diff --git a/crates/collab/migrations/20251117215316_add_external_id_to_billing_customers.sql b/crates/collab/migrations/20251117215316_add_external_id_to_billing_customers.sqldeleted file mode 100644index 6add45d4ad5..00000000000--- a/crates/collab/migrations/20251117215316_add_external_id_to_billing_customers.sql+++ /dev/null@@ -1,4 +0,0 @@-alter table billing_customers- add column external_id text;--create unique index uix_billing_customers_on_external_id on billing_customers (external_id);diff --git a/crates/collab/migrations/20251203234258_add_remote_urls_to_project_repositories.sql b/crates/collab/migrations/20251203234258_add_remote_urls_to_project_repositories.sqldeleted file mode 100644index e1396de27d9..00000000000--- a/crates/collab/migrations/20251203234258_add_remote_urls_to_project_repositories.sql+++ /dev/null@@ -1,2 +0,0 @@-ALTER TABLE "project_repositories" ADD COLUMN "remote_upstream_url" VARCHAR;-ALTER TABLE "project_repositories" ADD COLUMN "remote_origin_url" VARCHAR;diff --git a/crates/collab/migrations/20251208000000_test_schema.sql b/crates/collab/migrations/20251208000000_test_schema.sqlnew file mode 100644index 00000000000..ed9c9d16dbd--- /dev/null+++ b/crates/collab/migrations/20251208000000_test_schema.sql@@ -0,0 +1,899 @@+CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;++CREATE TABLE public.access_tokens (+ id integer NOT NULL,+ user_id integer,+ hash character varying(128),+ impersonated_user_id integer+);++CREATE SEQUENCE public.access_tokens_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.access_tokens_id_seq OWNED BY public.access_tokens.id;++CREATE TABLE public.breakpoints (+ id integer NOT NULL,+ project_id integer NOT NULL,+ "position" integer NOT NULL,+ log_message text,+ worktree_id bigint NOT NULL,+ path text NOT NULL,+ kind character varying NOT NULL+);++CREATE SEQUENCE public.breakpoints_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.breakpoints_id_seq OWNED BY public.breakpoints.id;++CREATE TABLE public.buffer_operations (+ buffer_id integer NOT NULL,+ epoch integer NOT NULL,+ replica_id integer NOT NULL,+ lamport_timestamp integer NOT NULL,+ value bytea NOT NULL+);++CREATE TABLE public.buffer_snapshots (+ buffer_id integer NOT NULL,+ epoch integer NOT NULL,+ text text NOT NULL,+ operation_serialization_version integer NOT NULL+);++CREATE TABLE public.buffers (+ id integer NOT NULL,+ channel_id integer NOT NULL,+ epoch integer DEFAULT 0 NOT NULL,+ latest_operation_epoch integer,+ latest_operation_lamport_timestamp integer,+ latest_operation_replica_id integer+);++CREATE SEQUENCE public.buffers_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.buffers_id_seq OWNED BY public.buffers.id;++CREATE TABLE public.channel_buffer_collaborators (+ id integer NOT NULL,+ channel_id integer NOT NULL,+ connection_id integer NOT NULL,+ connection_server_id integer NOT NULL,+ connection_lost boolean DEFAULT false NOT NULL,+ user_id integer NOT NULL,+ replica_id integer NOT NULL+);++CREATE SEQUENCE public.channel_buffer_collaborators_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.channel_buffer_collaborators_id_seq OWNED BY public.channel_buffer_collaborators.id;++CREATE TABLE public.channel_chat_participants (+ id integer NOT NULL,+ user_id integer NOT NULL,+ channel_id integer NOT NULL,+ connection_id integer NOT NULL,+ connection_server_id integer NOT NULL+);++CREATE SEQUENCE public.channel_chat_participants_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.channel_chat_participants_id_seq OWNED BY public.channel_chat_participants.id;++CREATE TABLE public.channel_members (+ id integer NOT NULL,+ channel_id integer NOT NULL,+ user_id integer NOT NULL,+ accepted boolean DEFAULT false NOT NULL,+ updated_at timestamp without time zone DEFAULT now() NOT NULL,+ role text NOT NULL+);++CREATE SEQUENCE public.channel_members_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.channel_members_id_seq OWNED BY public.channel_members.id;++CREATE TABLE public.channels (+ id integer NOT NULL,+ name character varying NOT NULL,+ created_at timestamp without time zone DEFAULT now() NOT NULL,+ visibility text DEFAULT 'members'::text NOT NULL,+ parent_path text NOT NULL,+ requires_zed_cla boolean DEFAULT false NOT NULL,+ channel_order integer DEFAULT 1 NOT NULL+);++CREATE SEQUENCE public.channels_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.channels_id_seq OWNED BY public.channels.id;++CREATE TABLE public.contacts (+ id integer NOT NULL,+ user_id_a integer NOT NULL,+ user_id_b integer NOT NULL,+ a_to_b boolean NOT NULL,+ should_notify boolean NOT NULL,+ accepted boolean NOT NULL+);++CREATE SEQUENCE public.contacts_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.contacts_id_seq OWNED BY public.contacts.id;++CREATE TABLE public.contributors (+ user_id integer NOT NULL,+ signed_at timestamp without time zone DEFAULT now() NOT NULL+);++CREATE TABLE public.extension_versions (+ extension_id integer NOT NULL,+ version text NOT NULL,+ published_at timestamp without time zone DEFAULT now() NOT NULL,+ authors text NOT NULL,+ repository text NOT NULL,+ description text NOT NULL,+ download_count bigint DEFAULT 0 NOT NULL,+ schema_version integer DEFAULT 0 NOT NULL,+ wasm_api_version text,+ provides_themes boolean DEFAULT false NOT NULL,+ provides_icon_themes boolean DEFAULT false NOT NULL,+ provides_languages boolean DEFAULT false NOT NULL,+ provides_grammars boolean DEFAULT false NOT NULL,+ provides_language_servers boolean DEFAULT false NOT NULL,+ provides_context_servers boolean DEFAULT false NOT NULL,+ provides_slash_commands boolean DEFAULT false NOT NULL,+ provides_indexed_docs_providers boolean DEFAULT false NOT NULL,+ provides_snippets boolean DEFAULT false NOT NULL,+ provides_debug_adapters boolean DEFAULT false NOT NULL,+ provides_agent_servers boolean DEFAULT false NOT NULL+);++CREATE TABLE public.extensions (+ id integer NOT NULL,+ name text NOT NULL,+ external_id text NOT NULL,+ latest_version text NOT NULL,+ total_download_count bigint DEFAULT 0 NOT NULL+);++CREATE SEQUENCE public.extensions_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.extensions_id_seq OWNED BY public.extensions.id;++CREATE TABLE public.feature_flags (+ id integer NOT NULL,+ flag character varying(255) NOT NULL,+ enabled_for_all boolean DEFAULT false NOT NULL+);++CREATE SEQUENCE public.feature_flags_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.feature_flags_id_seq OWNED BY public.feature_flags.id;++CREATE TABLE public.followers (+ id integer NOT NULL,+ room_id integer NOT NULL,+ project_id integer NOT NULL,+ leader_connection_server_id integer NOT NULL,+ leader_connection_id integer NOT NULL,+ follower_connection_server_id integer NOT NULL,+ follower_connection_id integer NOT NULL+);++CREATE SEQUENCE public.followers_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.followers_id_seq OWNED BY public.followers.id;++CREATE TABLE public.language_servers (+ project_id integer NOT NULL,+ id bigint NOT NULL,+ name character varying NOT NULL,+ capabilities text NOT NULL,+ worktree_id bigint+);++CREATE TABLE public.notification_kinds (+ id integer NOT NULL,+ name character varying NOT NULL+);++CREATE SEQUENCE public.notification_kinds_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.notification_kinds_id_seq OWNED BY public.notification_kinds.id;++CREATE TABLE public.notifications (+ id integer NOT NULL,+ created_at timestamp without time zone DEFAULT now() NOT NULL,+ recipient_id integer NOT NULL,+ kind integer NOT NULL,+ entity_id integer,+ content text,+ is_read boolean DEFAULT false NOT NULL,+ response boolean+);++CREATE SEQUENCE public.notifications_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;++CREATE TABLE public.observed_buffer_edits (+ user_id integer NOT NULL,+ buffer_id integer NOT NULL,+ epoch integer NOT NULL,+ lamport_timestamp integer NOT NULL,+ replica_id integer NOT NULL+);++CREATE TABLE public.project_collaborators (+ id integer NOT NULL,+ project_id integer NOT NULL,+ connection_id integer NOT NULL,+ user_id integer NOT NULL,+ replica_id integer NOT NULL,+ is_host boolean NOT NULL,+ connection_server_id integer NOT NULL,+ committer_name character varying,+ committer_email character varying+);++CREATE SEQUENCE public.project_collaborators_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.project_collaborators_id_seq OWNED BY public.project_collaborators.id;++CREATE TABLE public.project_repositories (+ project_id integer NOT NULL,+ abs_path character varying,+ id bigint NOT NULL,+ legacy_worktree_id bigint,+ entry_ids character varying,+ branch character varying,+ scan_id bigint NOT NULL,+ is_deleted boolean NOT NULL,+ current_merge_conflicts character varying,+ branch_summary character varying,+ head_commit_details character varying,+ merge_message character varying+);++CREATE TABLE public.project_repository_statuses (+ project_id integer NOT NULL,+ repository_id bigint NOT NULL,+ repo_path character varying NOT NULL,+ status bigint NOT NULL,+ status_kind integer NOT NULL,+ first_status integer,+ second_status integer,+ scan_id bigint NOT NULL,+ is_deleted boolean NOT NULL+);++CREATE TABLE public.projects (+ id integer NOT NULL,+ host_user_id integer,+ unregistered boolean DEFAULT false NOT NULL,+ room_id integer,+ host_connection_id integer,+ host_connection_server_id integer,+ windows_paths boolean DEFAULT false+);++CREATE SEQUENCE public.projects_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.projects_id_seq OWNED BY public.projects.id;++CREATE TABLE public.room_participants (+ id integer NOT NULL,+ room_id integer NOT NULL,+ user_id integer NOT NULL,+ answering_connection_id integer,+ location_kind integer,+ location_project_id integer,+ initial_project_id integer,+ calling_user_id integer NOT NULL,+ calling_connection_id integer NOT NULL,+ answering_connection_lost boolean DEFAULT false NOT NULL,+ answering_connection_server_id integer,+ calling_connection_server_id integer,+ participant_index integer,+ role text+);++CREATE SEQUENCE public.room_participants_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.room_participants_id_seq OWNED BY public.room_participants.id;++CREATE TABLE public.rooms (+ id integer NOT NULL,+ live_kit_room character varying NOT NULL,+ channel_id integer+);++CREATE SEQUENCE public.rooms_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.rooms_id_seq OWNED BY public.rooms.id;++CREATE TABLE public.servers (+ id integer NOT NULL,+ environment character varying NOT NULL+);++CREATE SEQUENCE public.servers_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.servers_id_seq OWNED BY public.servers.id;++CREATE TABLE public.user_features (+ user_id integer NOT NULL,+ feature_id integer NOT NULL+);++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,+ invite_code character varying(64),+ invite_count integer DEFAULT 0 NOT NULL,+ inviter_id integer,+ connected_once boolean DEFAULT false NOT NULL,+ created_at timestamp without time zone DEFAULT now() NOT NULL,+ github_user_id integer NOT NULL,+ 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+);++CREATE SEQUENCE public.users_id_seq+ AS integer+ START WITH 1+ INCREMENT BY 1+ NO MINVALUE+ NO MAXVALUE+ CACHE 1;++ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;++CREATE TABLE public.worktree_diagnostic_summaries (+ project_id integer NOT NULL,+ worktree_id bigint NOT NULL,+ path character varying NOT NULL,+ language_server_id bigint NOT NULL,+ error_count integer NOT NULL,+ warning_count integer NOT NULL+);++CREATE TABLE public.worktree_entries (+ project_id integer NOT NULL,+ worktree_id bigint NOT NULL,+ id bigint NOT NULL,+ is_dir boolean NOT NULL,+ path character varying NOT NULL,+ inode bigint NOT NULL,+ mtime_seconds bigint NOT NULL,+ mtime_nanos integer NOT NULL,+ is_symlink boolean DEFAULT false NOT NULL,+ is_ignored boolean NOT NULL,+ scan_id bigint,+ is_deleted boolean,+ git_status bigint,+ is_external boolean DEFAULT false NOT NULL,+ is_fifo boolean DEFAULT false NOT NULL,+ canonical_path text,+ is_hidden boolean DEFAULT false NOT NULL+);++CREATE TABLE public.worktree_settings_files (+ project_id integer NOT NULL,+ worktree_id bigint NOT NULL,+ path character varying NOT NULL,+ content text NOT NULL,+ kind character varying+);++CREATE TABLE public.worktrees (+ project_id integer NOT NULL,+ id bigint NOT NULL,+ root_name character varying NOT NULL,+ abs_path character varying NOT NULL,+ visible boolean NOT NULL,+ scan_id bigint NOT NULL,+ is_complete boolean DEFAULT false NOT NULL,+ completed_scan_id bigint+);++ALTER TABLE ONLY public.access_tokens ALTER COLUMN id SET DEFAULT nextval('public.access_tokens_id_seq'::regclass);++ALTER TABLE ONLY public.breakpoints ALTER COLUMN id SET DEFAULT nextval('public.breakpoints_id_seq'::regclass);++ALTER TABLE ONLY public.buffers ALTER COLUMN id SET DEFAULT nextval('public.buffers_id_seq'::regclass);++ALTER TABLE ONLY public.channel_buffer_collaborators ALTER COLUMN id SET DEFAULT nextval('public.channel_buffer_collaborators_id_seq'::regclass);++ALTER TABLE ONLY public.channel_chat_participants ALTER COLUMN id SET DEFAULT nextval('public.channel_chat_participants_id_seq'::regclass);++ALTER TABLE ONLY public.channel_members ALTER COLUMN id SET DEFAULT nextval('public.channel_members_id_seq'::regclass);++ALTER TABLE ONLY public.channels ALTER COLUMN id SET DEFAULT nextval('public.channels_id_seq'::regclass);++ALTER TABLE ONLY public.contacts ALTER COLUMN id SET DEFAULT nextval('public.contacts_id_seq'::regclass);++ALTER TABLE ONLY public.extensions ALTER COLUMN id SET DEFAULT nextval('public.extensions_id_seq'::regclass);++ALTER TABLE ONLY public.feature_flags ALTER COLUMN id SET DEFAULT nextval('public.feature_flags_id_seq'::regclass);++ALTER TABLE ONLY public.followers ALTER COLUMN id SET DEFAULT nextval('public.followers_id_seq'::regclass);++ALTER TABLE ONLY public.notification_kinds ALTER COLUMN id SET DEFAULT nextval('public.notification_kinds_id_seq'::regclass);++ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass);++ALTER TABLE ONLY public.project_collaborators ALTER COLUMN id SET DEFAULT nextval('public.project_collaborators_id_seq'::regclass);++ALTER TABLE ONLY public.projects ALTER COLUMN id SET DEFAULT nextval('public.projects_id_seq'::regclass);++ALTER TABLE ONLY public.room_participants ALTER COLUMN id SET DEFAULT nextval('public.room_participants_id_seq'::regclass);++ALTER TABLE ONLY public.rooms ALTER COLUMN id SET DEFAULT nextval('public.rooms_id_seq'::regclass);++ALTER TABLE ONLY public.servers ALTER COLUMN id SET DEFAULT nextval('public.servers_id_seq'::regclass);++ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);++ALTER TABLE ONLY public.access_tokens+ ADD CONSTRAINT access_tokens_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.breakpoints+ ADD CONSTRAINT breakpoints_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.buffer_operations+ ADD CONSTRAINT buffer_operations_pkey PRIMARY KEY (buffer_id, epoch, lamport_timestamp, replica_id);++ALTER TABLE ONLY public.buffer_snapshots+ ADD CONSTRAINT buffer_snapshots_pkey PRIMARY KEY (buffer_id, epoch);++ALTER TABLE ONLY public.buffers+ ADD CONSTRAINT buffers_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.channel_buffer_collaborators+ ADD CONSTRAINT channel_buffer_collaborators_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.channel_chat_participants+ ADD CONSTRAINT channel_chat_participants_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.channel_members+ ADD CONSTRAINT channel_members_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.channels+ ADD CONSTRAINT channels_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.contacts+ ADD CONSTRAINT contacts_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.contributors+ ADD CONSTRAINT contributors_pkey PRIMARY KEY (user_id);++ALTER TABLE ONLY public.extension_versions+ ADD CONSTRAINT extension_versions_pkey PRIMARY KEY (extension_id, version);++ALTER TABLE ONLY public.extensions+ ADD CONSTRAINT extensions_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.feature_flags+ ADD CONSTRAINT feature_flags_flag_key UNIQUE (flag);++ALTER TABLE ONLY public.feature_flags+ ADD CONSTRAINT feature_flags_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.followers+ ADD CONSTRAINT followers_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.language_servers+ ADD CONSTRAINT language_servers_pkey PRIMARY KEY (project_id, id);++ALTER TABLE ONLY public.notification_kinds+ ADD CONSTRAINT notification_kinds_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.notifications+ ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.observed_buffer_edits+ ADD CONSTRAINT observed_buffer_edits_pkey PRIMARY KEY (user_id, buffer_id);++ALTER TABLE ONLY public.project_collaborators+ ADD CONSTRAINT project_collaborators_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.project_repositories+ ADD CONSTRAINT project_repositories_pkey PRIMARY KEY (project_id, id);++ALTER TABLE ONLY public.project_repository_statuses+ ADD CONSTRAINT project_repository_statuses_pkey PRIMARY KEY (project_id, repository_id, repo_path);++ALTER TABLE ONLY public.projects+ ADD CONSTRAINT projects_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.room_participants+ ADD CONSTRAINT room_participants_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.rooms+ ADD CONSTRAINT rooms_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.servers+ ADD CONSTRAINT servers_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.user_features+ ADD CONSTRAINT user_features_pkey PRIMARY KEY (user_id, feature_id);++ALTER TABLE ONLY public.users+ ADD CONSTRAINT users_pkey PRIMARY KEY (id);++ALTER TABLE ONLY public.worktree_diagnostic_summaries+ ADD CONSTRAINT worktree_diagnostic_summaries_pkey PRIMARY KEY (project_id, worktree_id, path);++ALTER TABLE ONLY public.worktree_entries+ ADD CONSTRAINT worktree_entries_pkey PRIMARY KEY (project_id, worktree_id, id);++ALTER TABLE ONLY public.worktree_settings_files+ ADD CONSTRAINT worktree_settings_files_pkey PRIMARY KEY (project_id, worktree_id, path);++ALTER TABLE ONLY public.worktrees+ ADD CONSTRAINT worktrees_pkey PRIMARY KEY (project_id, id);++CREATE INDEX index_access_tokens_user_id ON public.access_tokens USING btree (user_id);++CREATE INDEX index_breakpoints_on_project_id ON public.breakpoints USING btree (project_id);++CREATE INDEX index_buffers_on_channel_id ON public.buffers USING btree (channel_id);++CREATE INDEX index_channel_buffer_collaborators_on_channel_id ON public.channel_buffer_collaborators USING btree (channel_id);++CREATE UNIQUE INDEX index_channel_buffer_collaborators_on_channel_id_and_replica_id ON public.channel_buffer_collaborators USING btree (channel_id, replica_id);++CREATE UNIQUE INDEX index_channel_buffer_collaborators_on_channel_id_connection_id_ ON public.channel_buffer_collaborators USING btree (channel_id, connection_id, connection_server_id);++CREATE INDEX index_channel_buffer_collaborators_on_connection_id ON public.channel_buffer_collaborators USING btree (connection_id);++CREATE INDEX index_channel_buffer_collaborators_on_connection_server_id ON public.channel_buffer_collaborators USING btree (connection_server_id);++CREATE INDEX index_channel_chat_participants_on_channel_id ON public.channel_chat_participants USING btree (channel_id);++CREATE UNIQUE INDEX index_channel_members_on_channel_id_and_user_id ON public.channel_members USING btree (channel_id, user_id);++CREATE INDEX index_channels_on_parent_path ON public.channels USING btree (parent_path text_pattern_ops);++CREATE INDEX index_channels_on_parent_path_and_order ON public.channels USING btree (parent_path, channel_order);++CREATE INDEX index_contacts_user_id_b ON public.contacts USING btree (user_id_b);++CREATE UNIQUE INDEX index_contacts_user_ids ON public.contacts USING btree (user_id_a, user_id_b);++CREATE UNIQUE INDEX index_extensions_external_id ON public.extensions USING btree (external_id);++CREATE INDEX index_extensions_total_download_count ON public.extensions USING btree (total_download_count);++CREATE UNIQUE INDEX index_feature_flags ON public.feature_flags USING btree (id);++CREATE UNIQUE INDEX index_followers_on_project_id_and_leader_connection_server_id_a ON public.followers USING btree (project_id, leader_connection_server_id, leader_connection_id, follower_connection_server_id, follower_connection_id);++CREATE INDEX index_followers_on_room_id ON public.followers USING btree (room_id);++CREATE UNIQUE INDEX index_invite_code_users ON public.users USING btree (invite_code);++CREATE INDEX index_language_servers_on_project_id ON public.language_servers USING btree (project_id);++CREATE UNIQUE INDEX index_notification_kinds_on_name ON public.notification_kinds USING btree (name);++CREATE INDEX index_notifications_on_recipient_id_is_read_kind_entity_id ON public.notifications USING btree (recipient_id, is_read, kind, entity_id);++CREATE UNIQUE INDEX index_observed_buffer_user_and_buffer_id ON public.observed_buffer_edits USING btree (user_id, buffer_id);++CREATE INDEX index_project_collaborators_on_connection_id ON public.project_collaborators USING btree (connection_id);++CREATE INDEX index_project_collaborators_on_connection_server_id ON public.project_collaborators USING btree (connection_server_id);++CREATE INDEX index_project_collaborators_on_project_id ON public.project_collaborators USING btree (project_id);++CREATE UNIQUE INDEX index_project_collaborators_on_project_id_and_replica_id ON public.project_collaborators USING btree (project_id, replica_id);++CREATE UNIQUE INDEX index_project_collaborators_on_project_id_connection_id_and_ser ON public.project_collaborators USING btree (project_id, connection_id, connection_server_id);++CREATE INDEX index_project_repos_statuses_on_project_id ON public.project_repository_statuses USING btree (project_id);++CREATE INDEX index_project_repos_statuses_on_project_id_and_repo_id ON public.project_repository_statuses USING btree (project_id, repository_id);++CREATE INDEX index_project_repositories_on_project_id ON public.project_repositories USING btree (project_id);++CREATE INDEX index_projects_on_host_connection_id_and_host_connection_server ON public.projects USING btree (host_connection_id, host_connection_server_id);++CREATE INDEX index_projects_on_host_connection_server_id ON public.projects USING btree (host_connection_server_id);++CREATE INDEX index_room_participants_on_answering_connection_id ON public.room_participants USING btree (answering_connection_id);++CREATE UNIQUE INDEX index_room_participants_on_answering_connection_id_and_answerin ON public.room_participants USING btree (answering_connection_id, answering_connection_server_id);++CREATE INDEX index_room_participants_on_answering_connection_server_id ON public.room_participants USING btree (answering_connection_server_id);++CREATE INDEX index_room_participants_on_calling_connection_server_id ON public.room_participants USING btree (calling_connection_server_id);++CREATE INDEX index_room_participants_on_room_id ON public.room_participants USING btree (room_id);++CREATE UNIQUE INDEX index_room_participants_on_user_id ON public.room_participants USING btree (user_id);++CREATE UNIQUE INDEX index_rooms_on_channel_id ON public.rooms USING btree (channel_id);++CREATE INDEX index_settings_files_on_project_id ON public.worktree_settings_files USING btree (project_id);++CREATE INDEX index_settings_files_on_project_id_and_wt_id ON public.worktree_settings_files USING btree (project_id, worktree_id);++CREATE INDEX index_user_features_on_feature_id ON public.user_features USING btree (feature_id);++CREATE INDEX index_user_features_on_user_id ON public.user_features USING btree (user_id);++CREATE UNIQUE INDEX index_user_features_user_id_and_feature_id ON public.user_features USING btree (user_id, feature_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);++CREATE INDEX index_worktree_diagnostic_summaries_on_project_id_and_worktree_ ON public.worktree_diagnostic_summaries USING btree (project_id, worktree_id);++CREATE INDEX index_worktree_entries_on_project_id ON public.worktree_entries USING btree (project_id);++CREATE INDEX index_worktree_entries_on_project_id_and_worktree_id ON public.worktree_entries USING btree (project_id, worktree_id);++CREATE INDEX index_worktrees_on_project_id ON public.worktrees USING btree (project_id);++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 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.access_tokens+ ADD CONSTRAINT access_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.breakpoints+ ADD CONSTRAINT breakpoints_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.buffer_operations+ ADD CONSTRAINT buffer_operations_buffer_id_fkey FOREIGN KEY (buffer_id) REFERENCES public.buffers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.buffer_snapshots+ ADD CONSTRAINT buffer_snapshots_buffer_id_fkey FOREIGN KEY (buffer_id) REFERENCES public.buffers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.buffers+ ADD CONSTRAINT buffers_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.channels(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_buffer_collaborators+ ADD CONSTRAINT channel_buffer_collaborators_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.channels(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_buffer_collaborators+ ADD CONSTRAINT channel_buffer_collaborators_connection_server_id_fkey FOREIGN KEY (connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_buffer_collaborators+ ADD CONSTRAINT channel_buffer_collaborators_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_chat_participants+ ADD CONSTRAINT channel_chat_participants_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.channels(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_chat_participants+ ADD CONSTRAINT channel_chat_participants_connection_server_id_fkey FOREIGN KEY (connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_chat_participants+ ADD CONSTRAINT channel_chat_participants_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);++ALTER TABLE ONLY public.channel_members+ ADD CONSTRAINT channel_members_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.channels(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.channel_members+ ADD CONSTRAINT channel_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.contacts+ ADD CONSTRAINT contacts_user_id_a_fkey FOREIGN KEY (user_id_a) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.contacts+ ADD CONSTRAINT contacts_user_id_b_fkey FOREIGN KEY (user_id_b) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.contributors+ ADD CONSTRAINT contributors_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);++ALTER TABLE ONLY public.extension_versions+ ADD CONSTRAINT extension_versions_extension_id_fkey FOREIGN KEY (extension_id) REFERENCES public.extensions(id);++ALTER TABLE ONLY public.project_repositories+ ADD CONSTRAINT fk_project_repositories_project_id FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.project_repository_statuses+ ADD CONSTRAINT fk_project_repository_statuses_project_id FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.followers+ ADD CONSTRAINT followers_follower_connection_server_id_fkey FOREIGN KEY (follower_connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.followers+ ADD CONSTRAINT followers_leader_connection_server_id_fkey FOREIGN KEY (leader_connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.followers+ ADD CONSTRAINT followers_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.followers+ ADD CONSTRAINT followers_room_id_fkey FOREIGN KEY (room_id) REFERENCES public.rooms(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.language_servers+ ADD CONSTRAINT language_servers_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.notifications+ ADD CONSTRAINT notifications_kind_fkey FOREIGN KEY (kind) REFERENCES public.notification_kinds(id);++ALTER TABLE ONLY public.notifications+ ADD CONSTRAINT notifications_recipient_id_fkey FOREIGN KEY (recipient_id) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.observed_buffer_edits+ ADD CONSTRAINT observed_buffer_edits_buffer_id_fkey FOREIGN KEY (buffer_id) REFERENCES public.buffers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.observed_buffer_edits+ ADD CONSTRAINT observed_buffer_edits_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.project_collaborators+ ADD CONSTRAINT project_collaborators_connection_server_id_fkey FOREIGN KEY (connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.project_collaborators+ ADD CONSTRAINT project_collaborators_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.projects+ ADD CONSTRAINT projects_host_connection_server_id_fkey FOREIGN KEY (host_connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.projects+ ADD CONSTRAINT projects_host_user_id_fkey FOREIGN KEY (host_user_id) REFERENCES public.users(id);++ALTER TABLE ONLY public.projects+ ADD CONSTRAINT projects_room_id_fkey FOREIGN KEY (room_id) REFERENCES public.rooms(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.room_participants+ ADD CONSTRAINT room_participants_answering_connection_server_id_fkey FOREIGN KEY (answering_connection_server_id) REFERENCES public.servers(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.room_participants+ ADD CONSTRAINT room_participants_calling_connection_server_id_fkey FOREIGN KEY (calling_connection_server_id) REFERENCES public.servers(id) ON DELETE SET NULL;++ALTER TABLE ONLY public.room_participants+ ADD CONSTRAINT room_participants_calling_user_id_fkey FOREIGN KEY (calling_user_id) REFERENCES public.users(id);++ALTER TABLE ONLY public.room_participants+ ADD CONSTRAINT room_participants_room_id_fkey FOREIGN KEY (room_id) REFERENCES public.rooms(id);++ALTER TABLE ONLY public.room_participants+ ADD CONSTRAINT room_participants_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);++ALTER TABLE ONLY public.rooms+ ADD CONSTRAINT rooms_channel_id_fkey FOREIGN KEY (channel_id) REFERENCES public.channels(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.user_features+ ADD CONSTRAINT user_features_feature_id_fkey FOREIGN KEY (feature_id) REFERENCES public.feature_flags(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.user_features+ ADD CONSTRAINT user_features_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;++ALTER TABLE ONLY public.users+ ADD CONSTRAINT users_inviter_id_fkey FOREIGN KEY (inviter_id) REFERENCES public.users(id) ON DELETE SET NULL;++ALTER TABLE ONLY public.worktree_diagnostic_summaries+ ADD CONSTRAINT worktree_diagnostic_summaries_project_id_worktree_id_fkey FOREIGN KEY (project_id, worktree_id) REFERENCES public.worktrees(project_id, id) ON DELETE CASCADE;++ALTER TABLE ONLY public.worktree_entries+ ADD CONSTRAINT worktree_entries_project_id_worktree_id_fkey FOREIGN KEY (project_id, worktree_id) REFERENCES public.worktrees(project_id, id) ON DELETE CASCADE;++ALTER TABLE ONLY public.worktree_settings_files+ ADD CONSTRAINT worktree_settings_files_project_id_worktree_id_fkey FOREIGN KEY (project_id, worktree_id) REFERENCES public.worktrees(project_id, id) ON DELETE CASCADE;++ALTER TABLE ONLY public.worktrees+ ADD CONSTRAINT worktrees_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE;diff --git a/crates/collab/migrations_llm/20240806182921_create_providers_and_models.sql b/crates/collab/migrations_llm/20240806182921_create_providers_and_models.sqldeleted file mode 100644index b81ab7567f2..00000000000--- a/crates/collab/migrations_llm/20240806182921_create_providers_and_models.sql+++ /dev/null@@ -1,19 +0,0 @@-create table if not exists providers (- id serial primary key,- name text not null-);--create unique index uix_providers_on_name on providers (name);--create table if not exists models (- id serial primary key,- provider_id integer not null references providers (id) on delete cascade,- name text not null,- max_requests_per_minute integer not null,- max_tokens_per_minute integer not null,- max_tokens_per_day integer not null-);--create unique index uix_models_on_provider_id_name on models (provider_id, name);-create index ix_models_on_provider_id on models (provider_id);-create index ix_models_on_name on models (name);diff --git a/crates/collab/migrations_llm/20240806213401_create_usages.sql b/crates/collab/migrations_llm/20240806213401_create_usages.sqldeleted file mode 100644index da2245d4b9a..00000000000--- a/crates/collab/migrations_llm/20240806213401_create_usages.sql+++ /dev/null@@ -1,19 +0,0 @@-create table usage_measures (- id serial primary key,- name text not null-);--create unique index uix_usage_measures_on_name on usage_measures (name);--create table if not exists usages (- id serial primary key,- user_id integer not null,- model_id integer not null references models (id) on delete cascade,- measure_id integer not null references usage_measures (id) on delete cascade,- timestamp timestamp without time zone not null,- buckets bigint[] not null-);--create index ix_usages_on_user_id on usages (user_id);-create index ix_usages_on_model_id on usages (model_id);-create unique index uix_usages_on_user_id_model_id_measure_id on usages (user_id, model_id, measure_id);diff --git a/crates/collab/migrations_llm/20240809130000_change_rate_limit_columns_to_bigint.sql b/crates/collab/migrations_llm/20240809130000_change_rate_limit_columns_to_bigint.sqldeleted file mode 100644index f1def8209a7..00000000000--- a/crates/collab/migrations_llm/20240809130000_change_rate_limit_columns_to_bigint.sql+++ /dev/null@@ -1,4 +0,0 @@-ALTER TABLE models- ALTER COLUMN max_requests_per_minute TYPE bigint,- ALTER COLUMN max_tokens_per_minute TYPE bigint,- ALTER COLUMN max_tokens_per_day TYPE bigint;diff --git a/crates/collab/migrations_llm/20240809160000_add_pricing_columns_to_models.sql b/crates/collab/migrations_llm/20240809160000_add_pricing_columns_to_models.sqldeleted file mode 100644index d9ffe2f9f29..00000000000--- a/crates/collab/migrations_llm/20240809160000_add_pricing_columns_to_models.sql+++ /dev/null@@ -1,3 +0,0 @@-ALTER TABLE models- ADD COLUMN price_per_million_input_tokens integer NOT NULL DEFAULT 0,- ADD COLUMN price_per_million_output_tokens integer NOT NULL DEFAULT 0;diff --git a/crates/collab/migrations_llm/20240812184444_add_is_staff_to_usages.sql b/crates/collab/migrations_llm/20240812184444_add_is_staff_to_usages.sqldeleted file mode 100644index a50feb2e3f4..00000000000--- a/crates/collab/migrations_llm/20240812184444_add_is_staff_to_usages.sql+++ /dev/null@@ -1 +0,0 @@-alter table usages add column is_staff boolean not null default false;diff --git a/crates/collab/migrations_llm/20240812225346_create_lifetime_usages.sql b/crates/collab/migrations_llm/20240812225346_create_lifetime_usages.sqldeleted file mode 100644index 42047433e56..00000000000--- a/crates/collab/migrations_llm/20240812225346_create_lifetime_usages.sql+++ /dev/null@@ -1,9 +0,0 @@-create table lifetime_usages (- id serial primary key,- user_id integer not null,- model_id integer not null references models (id) on delete cascade,- input_tokens bigint not null default 0,- output_tokens bigint not null default 0-);--create unique index uix_lifetime_usages_on_user_id_model_id on lifetime_usages (user_id, model_id);diff --git a/crates/collab/migrations_llm/20240813002237_add_revoked_access_tokens_table.sql b/crates/collab/migrations_llm/20240813002237_add_revoked_access_tokens_table.sqldeleted file mode 100644index c30e58a6dd8..00000000000--- a/crates/collab/migrations_llm/20240813002237_add_revoked_access_tokens_table.sql+++ /dev/null@@ -1,7 +0,0 @@-create table revoked_access_tokens (- id serial primary key,- jti text not null,- revoked_at timestamp without time zone not null default now()-);--create unique index uix_revoked_access_tokens_on_jti on revoked_access_tokens (jti);diff --git a/crates/collab/migrations_llm/20241007173634_add_cache_token_counts.sql b/crates/collab/migrations_llm/20241007173634_add_cache_token_counts.sqldeleted file mode 100644index 855e46ab022..00000000000--- a/crates/collab/migrations_llm/20241007173634_add_cache_token_counts.sql+++ /dev/null@@ -1,11 +0,0 @@-alter table models- add column price_per_million_cache_creation_input_tokens integer not null default 0,- add column price_per_million_cache_read_input_tokens integer not null default 0;--alter table usages- add column cache_creation_input_tokens_this_month bigint not null default 0,- add column cache_read_input_tokens_this_month bigint not null default 0;--alter table lifetime_usages- add column cache_creation_input_tokens bigint not null default 0,- add column cache_read_input_tokens bigint not null default 0;diff --git a/crates/collab/migrations_llm/20241007220716_drop_incorrect_usages_columns.sql b/crates/collab/migrations_llm/20241007220716_drop_incorrect_usages_columns.sqldeleted file mode 100644index c204451b753..00000000000--- a/crates/collab/migrations_llm/20241007220716_drop_incorrect_usages_columns.sql+++ /dev/null@@ -1,3 +0,0 @@-alter table usages- drop column cache_creation_input_tokens_this_month,- drop column cache_read_input_tokens_this_month;diff --git a/crates/collab/migrations_llm/20241008155620_create_monthly_usages.sql b/crates/collab/migrations_llm/20241008155620_create_monthly_usages.sqldeleted file mode 100644index 2733552a3a1..00000000000--- a/crates/collab/migrations_llm/20241008155620_create_monthly_usages.sql+++ /dev/null@@ -1,13 +0,0 @@-create table monthly_usages (- id serial primary key,- user_id integer not null,- model_id integer not null references models (id) on delete cascade,- month integer not null,- year integer not null,- input_tokens bigint not null default 0,- cache_creation_input_tokens bigint not null default 0,- cache_read_input_tokens bigint not null default 0,- output_tokens bigint not null default 0-);--create unique index uix_monthly_usages_on_user_id_model_id_month_year on monthly_usages (user_id, model_id, month, year);diff --git a/crates/collab/migrations_llm/20241010151249_create_billing_events.sql b/crates/collab/migrations_llm/20241010151249_create_billing_events.sqldeleted file mode 100644index 74a270872e5..00000000000--- a/crates/collab/migrations_llm/20241010151249_create_billing_events.sql+++ /dev/null@@ -1,12 +0,0 @@-create table billing_events (- id serial primary key,- idempotency_key uuid not null default gen_random_uuid(),- user_id integer not null,- model_id integer not null references models (id) on delete cascade,- input_tokens bigint not null default 0,- input_cache_creation_tokens bigint not null default 0,- input_cache_read_tokens bigint not null default 0,- output_tokens bigint not null default 0-);--create index uix_billing_events_on_user_id_model_id on billing_events (user_id, model_id);diff --git a/crates/collab/migrations_llm/20250404141155_add_granular_token_limits_to_models.sql b/crates/collab/migrations_llm/20250404141155_add_granular_token_limits_to_models.sqldeleted file mode 100644index e5c50d83857..00000000000--- a/crates/collab/migrations_llm/20250404141155_add_granular_token_limits_to_models.sql+++ /dev/null@@ -1,3 +0,0 @@-alter table models- add column max_input_tokens_per_minute bigint not null default 0,- add column max_output_tokens_per_minute bigint not null default 0;diff --git a/crates/collab/migrations_llm/20250415213005_add_subscription_usages.sql b/crates/collab/migrations_llm/20250415213005_add_subscription_usages.sqldeleted file mode 100644index b3873710580..00000000000--- a/crates/collab/migrations_llm/20250415213005_add_subscription_usages.sql+++ /dev/null@@ -1,10 +0,0 @@-create table subscription_usages (- id serial primary key,- user_id integer not null,- period_start_at timestamp without time zone not null,- period_end_at timestamp without time zone not null,- model_requests int not null default 0,- edit_predictions int not null default 0-);--create unique index uix_subscription_usages_on_user_id_start_at_end_at on subscription_usages (user_id, period_start_at, period_end_at);diff --git a/crates/collab/migrations_llm/20250416181354_add_plan_to_subscription_usages.sql b/crates/collab/migrations_llm/20250416181354_add_plan_to_subscription_usages.sqldeleted file mode 100644index 8d54c8b87ca..00000000000--- a/crates/collab/migrations_llm/20250416181354_add_plan_to_subscription_usages.sql+++ /dev/null@@ -1,4 +0,0 @@-alter table subscription_usages- add column plan text not null;--create index ix_subscription_usages_on_plan on subscription_usages (plan);diff --git a/crates/collab/migrations_llm/20250425171838_add_subscription_usage_meters.sql b/crates/collab/migrations_llm/20250425171838_add_subscription_usage_meters.sqldeleted file mode 100644index ded918e1838..00000000000--- a/crates/collab/migrations_llm/20250425171838_add_subscription_usage_meters.sql+++ /dev/null@@ -1,8 +0,0 @@-create table subscription_usage_meters (- id serial primary key,- subscription_usage_id integer not null references subscription_usages (id) on delete cascade,- model_id integer not null references models (id) on delete cascade,- requests integer not null default 0-);--create unique index uix_subscription_usage_meters_on_subscription_usage_model on subscription_usage_meters (subscription_usage_id, model_id);diff --git a/crates/collab/migrations_llm/20250429143553_add_mode_to_subscription_usage_meters.sql b/crates/collab/migrations_llm/20250429143553_add_mode_to_subscription_usage_meters.sqldeleted file mode 100644index 9d63e299f56..00000000000--- a/crates/collab/migrations_llm/20250429143553_add_mode_to_subscription_usage_meters.sql+++ /dev/null@@ -1,6 +0,0 @@-alter table subscription_usage_meters- add column mode text not null default 'normal';--drop index uix_subscription_usage_meters_on_subscription_usage_model;--create unique index uix_subscription_usage_meters_on_subscription_usage_model_mode on subscription_usage_meters (subscription_usage_id, model_id, mode);diff --git a/crates/collab/migrations_llm/20250503162708_add_v2_subscription_usage_and_meter_tables.sql b/crates/collab/migrations_llm/20250503162708_add_v2_subscription_usage_and_meter_tables.sqldeleted file mode 100644index 59169d3c3ec..00000000000--- a/crates/collab/migrations_llm/20250503162708_add_v2_subscription_usage_and_meter_tables.sql+++ /dev/null@@ -1,23 +0,0 @@-create table subscription_usages_v2 (- id uuid primary key,- user_id integer not null,- period_start_at timestamp without time zone not null,- period_end_at timestamp without time zone not null,- plan text not null,- model_requests int not null default 0,- edit_predictions int not null default 0-);--create unique index uix_subscription_usages_v2_on_user_id_start_at_end_at on subscription_usages_v2 (user_id, period_start_at, period_end_at);--create index ix_subscription_usages_v2_on_plan on subscription_usages_v2 (plan);--create table subscription_usage_meters_v2 (- id uuid primary key,- subscription_usage_id uuid not null references subscription_usages_v2 (id) on delete cascade,- model_id integer not null references models (id) on delete cascade,- mode text not null,- requests integer not null default 0-);--create unique index uix_subscription_usage_meters_v2_on_usage_model_mode on subscription_usage_meters_v2 (subscription_usage_id, model_id, mode);diff --git a/crates/collab/migrations_llm/20250504132836_drop_legacy_subscription_usage_and_meter_tables.sql b/crates/collab/migrations_llm/20250504132836_drop_legacy_subscription_usage_and_meter_tables.sqldeleted file mode 100644index f06b152d7ba..00000000000--- a/crates/collab/migrations_llm/20250504132836_drop_legacy_subscription_usage_and_meter_tables.sql+++ /dev/null@@ -1,2 +0,0 @@-drop table subscription_usage_meters;-drop table subscription_usages;diff --git a/crates/collab/migrations_llm/20250521211721_drop_monthly_and_lifetime_usages_tables.sql b/crates/collab/migrations_llm/20250521211721_drop_monthly_and_lifetime_usages_tables.sqldeleted file mode 100644index 5f03f50d0b3..00000000000--- a/crates/collab/migrations_llm/20250521211721_drop_monthly_and_lifetime_usages_tables.sql+++ /dev/null@@ -1,2 +0,0 @@-drop table monthly_usages;-drop table lifetime_usages;diff --git a/crates/collab/migrations_llm/20250521222416_drop_billing_events_table.sql b/crates/collab/migrations_llm/20250521222416_drop_billing_events_table.sqldeleted file mode 100644index 36b79266b6a..00000000000--- a/crates/collab/migrations_llm/20250521222416_drop_billing_events_table.sql+++ /dev/null@@ -1 +0,0 @@-drop table billing_events;diff --git a/typos.toml b/typos.tomlindex 6b1df15b40d..cfc4ec86a85 100644--- a/typos.toml+++ b/typos.toml@@ -11,16 +11,12 @@ extend-exclude = ["crates/theme/src/icon_theme.rs","crates/extensions_ui/src/extension_suggest.rs",- # Some countries codes are flagged as typos.- "crates/anthropic/src/supported_countries.rs",- "crates/google_ai/src/supported_countries.rs",- "crates/open_ai/src/supported_countries.rs",-# Some mock data is flagged as typos."crates/assistant_tools/src/web_search_tool.rs",- # Stripe IDs are flagged as typos.- "crates/collab/src/db/tests/processed_stripe_event_tests.rs",+ # Suppress false positives in database schema.+ "crates/collab/migrations/20251208000000_test_schema.sql",+# Not our typos."crates/livekit_api/",# Vim makes heavy use of partial typing tables.@@ -63,8 +59,6 @@ extend-ignore-re = ['cl\[ist]','\[lan\]guage','"ba"',- # :/ crates/collab/migrations/20231009181554_add_release_channel_to_rooms.sql- "COLUMN enviroment","doas",# ProtoLS crate with tree-sitter Protobuf grammar."protols",