Skip to content

ref(models): Delete CodeReviewEvent table [2/3]#109422

Merged
vaind merged 1 commit intomasterfrom
ref/delete-code-review-event
Feb 27, 2026
Merged

ref(models): Delete CodeReviewEvent table [2/3]#109422
vaind merged 1 commit intomasterfrom
ref/delete-code-review-event

Conversation

@vaind
Copy link
Copy Markdown
Contributor

@vaind vaind commented Feb 26, 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. ref(models): Pending-delete CodeReviewEvent table [1/3] #109420SafeDeleteModel with MOVE_TO_PENDING (removes model from Django state)
  2. This PRSafeDeleteModel with DELETE (drops the table)
  3. Recreate the model with updated schema

@github-actions
Copy link
Copy Markdown
Contributor

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

for 1034_remove_code_review_event in sentry

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

for 1035_delete_code_review_event in sentry

--
-- Delete model CodeReviewEvent
--
DROP TABLE "sentry_code_review_event" CASCADE;

@vaind vaind force-pushed the ref/delete-code-review-event branch from 7e4c976 to 756b38d Compare February 26, 2026 09:52
Base automatically changed from ref/delete-code-review-event-pending to master February 27, 2026 09:22
Drop the sentry_code_review_event table. This is the second step of the
safe deletion process (MOVE_TO_PENDING was in the previous migration).

The table will be recreated with an updated schema in a follow-up PR.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

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

for 1035_delete_code_review_event in sentry

--
-- Delete model CodeReviewEvent
--
DROP TABLE "sentry_code_review_event" CASCADE;

@vaind vaind marked this pull request as ready for review February 27, 2026 13:40
@vaind vaind requested a review from a team as a code owner February 27, 2026 13:40
@vaind vaind merged commit 416fbe7 into master Feb 27, 2026
77 checks passed
@vaind vaind deleted the ref/delete-code-review-event branch February 27, 2026 15:07
vaind added a commit that referenced this pull request Mar 4, 2026
…9424)

Recreate the `CodeReviewEvent` table with reviewer feedback from PR
#108531 applied:

- `DefaultFieldsModel` base class for standard
`date_added`/`date_updated` fields
- `FlexibleForeignKey` for organization and repository (cascade
deletion, referential integrity)
- `RelocationScope.Global` to match `Repository`'s scope (required for
org-scoped exports since Repository is Global)
- `DateUpdatedComparator` for `date_added`/`date_updated` in backup
comparators
- Backup test coverage in `create_exhaustive_organization()`

Migration is a clean auto-generated `CreateModel` — no manual edits.

**This is PR 3 of 3:**
1. #109420 — `SafeDeleteModel` with `MOVE_TO_PENDING` (merged)
2. #109422 — `SafeDeleteModel` with `DELETE` (merged)
3. **This PR** — Recreate with updated schema

---------

Co-authored-by: Claude <noreply@anthropic.com>
JonasBa pushed a commit that referenced this pull request Mar 5, 2026
…9424)

Recreate the `CodeReviewEvent` table with reviewer feedback from PR
#108531 applied:

- `DefaultFieldsModel` base class for standard
`date_added`/`date_updated` fields
- `FlexibleForeignKey` for organization and repository (cascade
deletion, referential integrity)
- `RelocationScope.Global` to match `Repository`'s scope (required for
org-scoped exports since Repository is Global)
- `DateUpdatedComparator` for `date_added`/`date_updated` in backup
comparators
- Backup test coverage in `create_exhaustive_organization()`

Migration is a clean auto-generated `CreateModel` — no manual edits.

**This is PR 3 of 3:**
1. #109420 — `SafeDeleteModel` with `MOVE_TO_PENDING` (merged)
2. #109422 — `SafeDeleteModel` with `DELETE` (merged)
3. **This PR** — Recreate with updated schema

---------

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants