Skip to content

ref(models): Pending-delete CodeReviewEvent table [1/3]#109420

Merged
vaind merged 4 commits intomasterfrom
ref/delete-code-review-event-pending
Feb 27, 2026
Merged

ref(models): Pending-delete CodeReviewEvent table [1/3]#109420
vaind merged 4 commits intomasterfrom
ref/delete-code-review-event-pending

Conversation

@vaind
Copy link
Contributor

@vaind vaind commented Feb 26, 2026

Remove the CodeReviewEvent model class and mark the table for pending deletion. The table has no data and will be recreated with an updated schema per reviewer feedback on PR #108531.

This is PR 1 of 3:

  1. This PRSafeDeleteModel with MOVE_TO_PENDING (removes model from Django state, keeps table in DB)
  2. SafeDeleteModel with DELETE (drops the table)
  3. Recreate the model with updated schema: DefaultFieldsModel, FlexibleForeignKey for org/repo, RelocationScope.Organization

The CodeReviewEventStatus enum is kept in the file since migration 1032 references it for the status field default.

Remove the CodeReviewEvent model class and mark the table for pending
deletion. The table has no data and will be recreated with an updated
schema (DefaultFieldsModel, FlexibleForeignKey, Organization relocation
scope) per reviewer feedback on PR #108531.

The CodeReviewEventStatus enum is kept since migration 1032 references
it for the status field default.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 26, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1034_remove_code_review_event.py

for 1034_remove_code_review_event in sentry

--
-- Moved model CodeReviewEvent to pending deletion state
--
-- (no-op)

The SafeDeleteModel DELETE migration needs to resolve the database for
the sentry_code_review_event table after the model class is removed.
Without this entry, the migration cannot determine the correct silo.

Co-Authored-By: Claude <noreply@anthropic.com>
@vaind vaind enabled auto-merge (squash) February 26, 2026 20:42
@vaind vaind disabled auto-merge February 26, 2026 20:42
@vaind vaind merged commit f570f5c into master Feb 27, 2026
76 of 77 checks passed
@vaind vaind deleted the ref/delete-code-review-event-pending branch February 27, 2026 09:22
vaind added a commit that referenced this pull request Feb 27, 2026
Drop the `sentry_code_review_event` table. This is the second step of
the safe deletion process.

**Stacked on #109420** (pending delete). Retarget to `master` after PR 1
merges.

**This is PR 2 of 3:**
1. #109420 — `SafeDeleteModel` with `MOVE_TO_PENDING` (removes model
from Django state)
2. **This PR** — `SafeDeleteModel` with `DELETE` (drops the table)
3. Recreate the model with updated schema

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants