Conversation
This was referenced Sep 13, 2026
Open
Contributor
Author
|
@MrAlders0n please review this change with your Claude agent as part of the September 13 Beacon review batch. The current candidate is Please check migration 034, active-name uniqueness, soft deactivation and preserved records. This is storage for account API #149, and these records are not login principals. Issue #60 remains open for the full admin scope. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Add the account-storage foundation for #60: an additive accounts table, active-name uniqueness, generated sqlc queries/mocks and a narrow AccountStore implementation. It is independent of pending authentication/API work and exposes no endpoint.
Names are trimmed, case-sensitive and limited to 128 Unicode characters without control characters. Deactivation preserves the row and timestamp; a later account can reuse the inactive name. Duplicate active names, absent IDs and repeated deactivation have distinct errors. A row-locking query makes concurrent deactivation return one success and one already-inactive outcome. The migration is retryable and creates no account data.
Type of change
Checklist
Testing notes
Native Pi 5/PostgreSQL 16 tests apply the migration twice and cover empty lists, Unicode/trimmed names, validation, case sensitivity, missing IDs, deactivation timestamp preservation, name reuse and deterministic lists. Eight concurrent creates yield one winner; repeated concurrent deactivation rounds yield one success each. Tests create and remove their own schema in the isolated test database. Full local/native checks and focused local race checks pass.
CI and CodeQL pass. The combined preview applied 034 with an empty accounts table, a valid partial unique index, and an unchanged schema dump for all pre-existing objects. The exact preceding binary also started and served its existing private test endpoints with the additive schema present; rollback retains the table and migration record. Account HTTP operations are the dependent draft #149.
AI-assisted implementation/testing under the contributor's standing authorization; submitted for review without claiming a new specific human diff review.