Files
mtusi2026lab2/evidence/migrations.txt
T

38 lines
1.1 KiB
Plaintext

# 2026-10-15T09:59Z повторный запуск миграций на заполненной БД
$ python -m app.migrate
applied: nothing (up to date)
$ psql: SELECT version, applied_at FROM schema_migrations; SELECT count(*) FROM users
version | applied_at
-----------+------------------------------
0001_init | 2026-10-15 12:50:12.87179+03
(1 row)
users
-------
46
(1 row)
$ python -m app.migrate (ещё раз)
applied: nothing (up to date)
users
-------
46
(1 row)
# миграции с нуля на пустой БД
$ DATABASE_URL=.../fresh python -m app.migrate
INFO:messenger.migrate:migration applied: 0001_init
applied: ['0001_init']
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+-----------
public | chat_members | table | messenger
public | chats | table | messenger
public | messages | table | messenger
public | schema_migrations | table | messenger
public | sessions | table | messenger
public | users | table | messenger
(6 rows)