User table - #37
Closed
Bartavius wants to merge 2 commits into
Closed
User table#37Bartavius wants to merge 2 commits into
Bartavius wants to merge 2 commits into
Conversation
The docs described a folder per feature under internal/features, each holding five files. The backend follows Toggo's layer-first split instead — models, repository, services, controllers, one file per domain in each — so both the README and the agent rules are brought in line. .claude/rules/backend.md already listed the right layers but was missing models/, the nesting of middlewares and routers under server/, and tests/mocks, and it described tests as sitting beside the code they cover. Docs only: no code changes. The move itself is on auth-jwt-sessions, so this describes a layout main does not have yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Layer-first user feature: gorm model, generated migration, repository, service, Huma controller, and POST /api/v1/users. - id defaults to gen_random_uuid(), and email carries a unique index over the normalized (lowercased, trimmed) form - last_name is optional, storing NULL for both an absent and a whitespace-only value so there is no third empty-string state - password is stored as a bcrypt hash at cost 12 and is never serialised into a response - register the model in cmd/atlasloader, which called Load() with no arguments and so printed an empty schema for Atlas to diff against - carry the repository through types.ServiceParams, constructed once in server/app.go The generated migration's DROP TABLE "examples" stanza was removed by hand and atlas.sum re-signed. The examples migration has no gorm model behind it, so Atlas reads it as a table to delete on every diff.
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.
Issue
Closes #
Screen recording
Overview
How to test
Checklist