mirror of
https://gitlab.com/glitchtip/glitchtip-backend.git
synced 2026-11-07 12:22:33 -05:00
Migration 0014 added the deferred organization_has_members constraint trigger, which rejects any transaction that leaves a live organization with no members. seed_data deleted the seeded users first, cascading to their OrganizationUser rows and orphaning the previous run's organization, so every seed after the first raised IntegrityError: [23514] organization 1 cannot be left without members; delete the organization instead Every frontend e2e spec seeds in `beforeEach`, so the second request in the first spec failed and took the run with it: 10 of 12 specs, 15 tests. Delete the organizations first instead — the guard accepts that because the organization row is gone by commit time. Orgs the seeded users belong to are matched alongside the name-matched ones, so a test org missing `e2etestobj` in its name can't wedge the next seed either. The existing test seeded once and passed throughout. The new cases seed twice and need TransactionTestCase, since a deferred trigger only fires on a real commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>