3bd237d562
Фаза 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
9 lines
289 B
SQL
9 lines
289 B
SQL
-- name: CreateProject :one
|
|
INSERT INTO projects (id, user_id, name) VALUES ($1, $2, $3) RETURNING *;
|
|
|
|
-- name: GetProjectOwned :one
|
|
SELECT * FROM projects WHERE id = $1 AND user_id = $2;
|
|
|
|
-- name: GetUserProject :one
|
|
SELECT * FROM projects WHERE user_id = $1 ORDER BY created_at LIMIT 1;
|