Move notes from account ownership onto membership

FeatureInitializerService
Shipped
August 14, 2026 at 11:07 PM UTC
Author
Kamo
Commit
efa2ebb

Adds notes.member_id and attaches each note to its owner's earliest membership — the organisation the account has belonged to longest, which in practice is where the notes were written. A note therefore lands in exactly one organisation rather than being duplicated into all of them; the count of accounts for which that choice was material is logged, because for them the notes stop being visible from their other orgs. @Order(0) for the reason every column-add runner is: once the shared-lib entity maps MEMBER_ID, any runner that loads a Note emits the column in its SELECT, and a migration ordered late would never be reached. The column arrives nullable — notes is populated and YugabyteDB rejects ADD COLUMN ... NOT NULL on such a table — and its default is dropped explicitly. An inherited unique_rowid() would stamp every existing note with a member id matching no row, which the backfill would then skip as already placed, hiding every note in the system at once. Run against production: column added, 3 note(s) placed, none unplaced.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing