LoginSignup
0
0

Alembicで現在適用されている最新のMigrationを確認する方法

Last updated at Posted at 2024-05-16

メモ

Migrationが現在適用されているのは、 alembic history結果の(head)がある部分だと勘違いしていた

➜ poetry run alembic history
6c52ef9fa20e -> 6d7e21f4d179 (head), add type to users
e7922bb77adc -> 6c52ef9fa20e, drop index
4649a7485736 -> e7922bb77adc, creator and sendor nullable
394800e0fa0e -> 4649a7485736, Add ai and anonymous user
3604267b7044 -> 394800e0fa0e, Increase message text size
c4d28179c9f3 -> 3604267b7044, add default ts to messages
b42d3974bfbf -> c4d28179c9f3, apply SQLAlchemy 2.0
e0522be70879 -> b42d3974bfbf, add user_id to thread
fd1027b6d882 -> e0522be70879, add user and thread
2848b16932f2 -> fd1027b6d882, Add ts to messages
<base> -> 2848b16932f2, Create message table

実際は、alembic current で表示されるVersionが、現在適用されている最新のMigrationであった

➜ poetry run alembic current
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
6c52ef9fa20e
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0