ЛР2: PostgreSQL, сессии и Valkey (на 4)
Skeleton contracts / contracts (pull_request) Canceled after 0s

API мессенджера на FastAPI + asyncpg, миграции, Argon2id, Bearer-сессии
в PostgreSQL с кэшем Valkey, compose-стенд, restart.sh, тесты уровня 4,
EXPLAIN и отчёт.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 18:49:32 +03:00
co-authored by Claude Opus 5.5
parent 65003b6119
commit 0c5846173b
31 changed files with 1880 additions and 15 deletions
+26
View File
@@ -0,0 +1,26 @@
# Migrations re-run evidence, 2026-10-29T15:36:22Z
$ docker compose run --rm migrate
skip 0001_init
$ select version, checksum, applied_at from schema_migrations
version | checksum | applied_at
-----------+------------------+-------------------------------
0001_init | b0f6ac0177a064da | 2026-10-29 15:27:31.980855+00
(1 row)
$ \d messages
Table "public.messages"
Column | Type | Collation | Nullable | Default
------------+--------------------------+-----------+----------+-------------------
id | uuid | | not null | gen_random_uuid()
chat_id | uuid | | not null |
sender_id | uuid | | not null |
text | text | | not null |
created_at | timestamp with time zone | | not null | clock_timestamp()
Indexes:
"messages_pkey" PRIMARY KEY, btree (id)
"messages_chat_created_id_idx" btree (chat_id, created_at, id)
Check constraints:
"messages_text_check" CHECK (char_length(text) >= 1 AND char_length(text) <= 4000)
Foreign-key constraints:
"messages_sender_is_member" FOREIGN KEY (chat_id, sender_id) REFERENCES chat_members(chat_id, user_id)