chore(repositories): Add a table to allow us to link a project to a repository#115331
Open
wedamija wants to merge 5 commits into
Open
chore(repositories): Add a table to allow us to link a project to a repository#115331wedamija wants to merge 5 commits into
wedamija wants to merge 5 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
d4f5722 to
8312052
Compare
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Create model ProjectRepository
--
CREATE TABLE "sentry_projectrepository" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "source" smallint NOT NULL, "project_id" bigint NOT NULL, "repository_id" bigint NOT NULL);
--
-- Add field project_repository to repositoryprojectpathconfig
--
ALTER TABLE "sentry_repositoryprojectpathconfig" ADD COLUMN "project_repository_id" bigint NULL;
CREATE UNIQUE INDEX CONCURRENTLY "sentry_projectrepository_project_id_repository_id_baccce58_uniq" ON "sentry_projectrepository" ("project_id", "repository_id");
ALTER TABLE "sentry_projectrepository" ADD CONSTRAINT "sentry_projectrepository_project_id_repository_id_baccce58_uniq" UNIQUE USING INDEX "sentry_projectrepository_project_id_repository_id_baccce58_uniq";
ALTER TABLE "sentry_projectrepository" ADD CONSTRAINT "sentry_projectreposi_project_id_15b94027_fk_sentry_pr" FOREIGN KEY ("project_id") REFERENCES "sentry_project" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_projectrepository" VALIDATE CONSTRAINT "sentry_projectreposi_project_id_15b94027_fk_sentry_pr";
ALTER TABLE "sentry_projectrepository" ADD CONSTRAINT "sentry_projectreposi_repository_id_46f90b5f_fk_sentry_re" FOREIGN KEY ("repository_id") REFERENCES "sentry_repository" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_projectrepository" VALIDATE CONSTRAINT "sentry_projectreposi_repository_id_46f90b5f_fk_sentry_re";
CREATE INDEX CONCURRENTLY "sentry_projectrepository_project_id_15b94027" ON "sentry_projectrepository" ("project_id");
CREATE INDEX CONCURRENTLY "sentry_projectrepository_repository_id_46f90b5f" ON "sentry_projectrepository" ("repository_id");
ALTER TABLE "sentry_repositoryprojectpathconfig" ADD CONSTRAINT "sentry_repositorypro_project_repository_i_3e830ad9_fk_sentry_pr" FOREIGN KEY ("project_repository_id") REFERENCES "sentry_projectrepository" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_repositoryprojectpathconfig" VALIDATE CONSTRAINT "sentry_repositorypro_project_repository_i_3e830ad9_fk_sentry_pr";
CREATE INDEX CONCURRENTLY "sentry_repositoryprojectpa_project_repository_id_3e830ad9" ON "sentry_repositoryprojectpathconfig" ("project_repository_id");for --
-- Add field project_repository to seerprojectrepository
--
ALTER TABLE "seer_projectrepository" ADD COLUMN "project_repository_id" bigint NULL;
ALTER TABLE "seer_projectrepository" ADD CONSTRAINT "seer_projectreposito_project_repository_i_bff6d0fe_fk_sentry_pr" FOREIGN KEY ("project_repository_id") REFERENCES "sentry_projectrepository" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "seer_projectrepository" VALIDATE CONSTRAINT "seer_projectreposito_project_repository_i_bff6d0fe_fk_sentry_pr";
CREATE INDEX CONCURRENTLY "seer_projectrepository_project_repository_id_bff6d0fe" ON "seer_projectrepository" ("project_repository_id"); |
…epository This adds in `ProjectRepository`, which will allow us to more explicitly link a project to a repository. We also have a `source` column, so we can determine whether the link was detected automatically or added by a user explicitly.
8312052 to
9fdecb2
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9fdecb2. Configure here.
The sentry migration was renumbered from 1086 to 1087 after a rebase, but the seer migration still referenced the old number.
armenzg
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This adds in
ProjectRepository, which will allow us to more explicitly link a project to a repository. We also have asourcecolumn, so we can determine whether the link was detected automatically or added by a user explicitly.Also adds links to this new table in seer and code mappings