feat: init new standard repositories tables [CM-864] #3719
Merged
+56
−0
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 pull request introduces two new database tables to support repository management and processing workflows. The changes add a
repositoriestable for tracking repository metadata and arepositoryProcessingtable for managing the state and processing of repositories, including onboarding and recurrent processing. Both tables include relevant indexes to optimize queries for common operations.Repository metadata and management:
repositoriestable in thepublicschema to store repository details such as URL, integration references, project association, archival status, and timestamps. Also added several indexes to improve query performance, especially for active (non-deleted) repositories.Repository processing workflow:
repositoryProcessingtable in thegitschema to track the processing state of repositories, including fields for processing state, priority, locking, last processed commit, and re-onboarding status. Created multiple indexes to optimize acquisition and counting of processing tasks based on state and locking.Note
Introduces two DB migrations to support repository metadata and processing workflows.
public.repositorieswith URL, integration and project refs, status flags (archived,excluded), timestamps, and optionalforkedFrom/lastArchivedCheckAt; adds indexes onsegmentId,sourceIntegrationId, andinsightsProjectId(filtered to non-deleted)git."repositoryProcessing"to track per-repo processing state (state,priority,lockedAt,lastProcessedAt/Commit, maintainer fields, re-onboarding flags/counters) with uniquerepositoryId; includes acquisition/counting indexes for pending/unlocked, recurrent, and active onboarding tasksWritten by Cursor Bugbot for commit 74e90ad. This will update automatically on new commits. Configure here.