Skip to content

fix(groups): conservar el historial de un grupo al borrarlo - #17

Merged
bpstack merged 2 commits into
claude/compassionate-planck-gh6aoffrom
opencode/fix-group-deletion
Oct 12, 2026
Merged

bpstack merged 2 commits into
claude/compassionate-planck-gh6aoffrom
opencode/fix-group-deletion

Conversation

@bpstack

@bpstack bpstack commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Cambios

  • Migración 20261011_keep_group_history_on_delete.sql: quita la clave foránea ON DELETE CASCADE de group_history (ya aplicada en Aiven el 2026-10-12).
  • Borrar un grupo escribe una fila deleted con la foto del grupo, en la misma transacción.
  • INDEX.md: migración marcada como aplicada en local y en Aiven.

Por qué

Borrar un grupo se llevaba todo su historial y no dejaba rastro. Decidido el 2026-10-11: el grupo se borra pero queda constancia.

- 20261011_keep_group_history_on_delete.sql: drops the ON DELETE CASCADE
  foreign key from group_history.group_id; idempotent.
- group-repository.ts: delete removes the group and writes a "deleted"
  history row with a snapshot of the group, in one transaction.
- group-controller.ts: passes the user and the group to delete.
- INDEX.md: registers the migration, applied locally, pending in Aiven.
- group-deletion.test.ts: the delete writes its row, rolls back when the
  row fails, writes nothing when there was no group; the migration exists.

Why: deleting a group deleted its whole history and logged nothing.
Decided on 2026-10-11: delete the group but keep a trace. Checked in the
browser against the local database with the migration applied: the
group is gone, its earlier history stays and a deleted row holds the
snapshot. The migration must reach Aiven before this code is deployed.
- INDEX.md: the migration row now reads applied on local and Aiven.

Why: it was applied on Aiven on 2026-10-12 after a dry run and read-only
checks of its preconditions, and verified afterwards.
@bpstack
bpstack merged commit 567922d into claude/compassionate-planck-gh6aof Oct 12, 2026
4 checks passed
@vercel

vercel Bot commented Oct 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
four-points Ready Ready Preview Oct 12, 2026 6:34pm UTC

@bpstack
bpstack deleted the opencode/fix-group-deletion branch October 12, 2026 19:02

This branch was successfully deployed

1 active deployment
Preview — 8f3de7bf Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant