feat(store): миграция sessions/password + методы users/sessions/projects

Фаза 2, Task 1: добавлена таблица sessions и nullable password_hash у
users, sqlc-запросы и *Store-обёртки (CreateUser, GetUserByEmail,
CreateProjectForUser, GetProjectOwned, GetUserProject, CreateSession,
GetSessionUser, DeleteSession, RegisterUser в транзакции), интеграционные
тесты на testcontainers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
2026-07-03 19:44:36 +07:00
parent bd82fe5509
commit 3bd237d562
10 changed files with 498 additions and 3 deletions
+12 -3
View File
@@ -43,6 +43,14 @@ type ProviderAccount struct {
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Session struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
TokenHash string `json:"token_hash"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Template struct {
ID uuid.UUID `json:"id"`
ProjectID uuid.UUID `json:"project_id"`
@@ -54,7 +62,8 @@ type Template struct {
}
type User struct {
ID uuid.UUID `json:"id"`
Email string `json:"email"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ID uuid.UUID `json:"id"`
Email string `json:"email"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
PasswordHash *string `json:"password_hash"`
}