Phase 4: Drop legacy entity tables #5932
Open
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.
Summary
This completes the migration to the unified entity model by removing the deprecated
repositories,artifacts, andpull_requestsdatabase tables.This is Phase 4 (the final phase) of the legacy table removal plan. Phases 1-3 have already been completed:
Changes
Database Migration
000114to drop legacy tables (repositories,artifacts,pull_requests)entity_instancesandpropertiestablesCode Cleanup
repositories.sql,artifacts.sqlrepositories.sql.go,artifacts.sql.godb.Repository,db.Artifact,db.PullRequeststructs from modelsPBRepositoryFromDBconverter (internal/repositories/db.go)Reminder Service Improvement
reminder_last_senttimestamp in databaseMinElapsedcheck against actual evaluation timesWhy this is better: The reminder service is now stateless and can scale horizontally. Instead of tracking "when did we last send a reminder", we check "when was this repository last evaluated". This is more reliable and eliminates unnecessary database writes.
Test Updates
EntityRepositorytest helper for entity-based repository testsEntityRepositoryinstead ofdb.Repositoryrepositories_test.goTest Plan
go test -race ./...make buildmake genMigration Path
VACUUMto reclaim disk spaceRisk Assessment
Risk Level: HIGH (irreversible table drops)
Mitigation:
Stats
🤖 Generated with Claude Code