refactor(store): single account name on users; rename profile/laps tables
users.display_name becomes users.name and is now the only human-facing name -- profiles.name is dropped (it duplicated the account name; the Profile page's Name field now edits users.name through PUT /api/profile, which carries Name alongside the profiles columns). The profile table becomes profiles and laps becomes activity_laps, homogeneous with activity_samples. Onboarding pre-fills the display name from the OIDC claim's name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -188,12 +188,12 @@ func TestIsolation_DeleteUserLeavesOtherUsersDataIntact(t *testing.T) {
|
||||
if _, found, err := db.GetUserBySub(ctx, "sub-b"); err != nil || !found {
|
||||
t.Fatalf("expected userB to survive userA's deletion, found=%v err=%v", found, err)
|
||||
}
|
||||
profileB, err := db.GetProfile(ctx, userB)
|
||||
if err != nil {
|
||||
if _, err := db.GetProfile(ctx, userB); err != nil {
|
||||
t.Fatalf("GetProfile(b) after deleting a: %v", err)
|
||||
}
|
||||
if profileB.Name != "B" {
|
||||
t.Errorf("userB's profile changed after deleting userA: %+v", profileB)
|
||||
userBRow, found, err := db.GetUserBySub(ctx, "sub-b")
|
||||
if err != nil || !found || userBRow.Name != "B" {
|
||||
t.Errorf("userB's account changed after deleting userA: %+v (found=%v err=%v)", userBRow, found, err)
|
||||
}
|
||||
kindsB, err := db.ListWorkoutKinds(ctx, userB, false)
|
||||
if err != nil || len(kindsB) != 8 {
|
||||
|
||||
Reference in New Issue
Block a user