diff --git a/crates/collab/migrations/20251208000000_test_schema.sql b/crates/collab/migrations/20251208000000_test_schema.sql index 0f4e4f2d2e3925ea1e4d2b964c5e4f159f393b4f..53543a23f710e49084a7b1127e7b743df6ef97c8 100644 --- a/crates/collab/migrations/20251208000000_test_schema.sql +++ b/crates/collab/migrations/20251208000000_test_schema.sql @@ -1,3 +1,6 @@ +-- This file is auto-generated. Do not modify it by hand. +-- To regenerate, run `cargo xtask db dump-schema app --collab` from the Cloud repository. + CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public; CREATE TABLE public.breakpoints ( @@ -315,10 +318,10 @@ CREATE TABLE public.project_repository_statuses ( status_kind integer NOT NULL, first_status integer, second_status integer, - lines_added integer, - lines_deleted integer, scan_id bigint NOT NULL, - is_deleted boolean NOT NULL + is_deleted boolean NOT NULL, + lines_added integer, + lines_deleted integer ); CREATE TABLE public.projects ( @@ -706,6 +709,8 @@ CREATE INDEX trigram_index_extensions_name ON public.extensions USING gin (name CREATE INDEX trigram_index_users_on_github_login ON public.users USING gin (github_login public.gin_trgm_ops); +CREATE INDEX trigram_index_users_on_name ON public.users USING gin (name public.gin_trgm_ops); + CREATE UNIQUE INDEX uix_channels_parent_path_name ON public.channels USING btree (parent_path, name) WHERE ((parent_path IS NOT NULL) AND (parent_path <> ''::text)); CREATE UNIQUE INDEX uix_users_on_github_user_id ON public.users USING btree (github_user_id); @@ -753,7 +758,7 @@ 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); + ADD CONSTRAINT contributors_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE; ALTER TABLE ONLY public.extension_versions ADD CONSTRAINT extension_versions_extension_id_fkey FOREIGN KEY (extension_id) REFERENCES public.extensions(id);