Give every Bookmark an owner #22
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#18
What to build
Rows stop being anonymous. A Reader table appears, every Bookmark belongs to one, and the owner is seeded as the first and only Reader with all existing rows attached.
Authentication does not change in this ticket — the global token and web password still work exactly as before. Nothing observable changes; the point is that ownership now exists underneath.
Acceptance criteria
Blocked by
#21
Implemented on branch
feat/reader-ownership(commit3f7664e).readerstable (discord_id UNIQUE, token_sha256 UNIQUE, created_at).keycolumn, composite PK(reader_id, site, series_id), FK to readersON DELETE CASCADE.Store.Openruns schema to 0003, seeds exactly one owner row fromOWNER_DISCORD_ID(hash = SHA-256 of API_TOKEN, refreshed on every start so rotation stays current), then migrates the rest.List/Get/Upsert/DeletetakereaderID; wirekeyderived assite:series_idon read. Handlers act asStore.OwnerID()while the global token remains the only credential — auth and wire format untouched.OWNER_DISCORD_ID(required); compose, .env.example, DEPLOY.md, README.md updated.go test ./...), plus a live smoke test (fresh Postgres: seed → PUT/GET → restart idempotent).