Skip to content

Commit b8fe19d

Browse files
anafroalxbavy
andcommitted
Add types to migrations.py
Co-Authored-By: Alexander Bavykin <bavykin.03@mail.ru>
1 parent e334edb commit b8fe19d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

migration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
models = []
1+
from typing import Callable
22

33

4-
def up():
4+
models: list = []
5+
6+
7+
def up() -> None:
58
for model in models:
69
print(f'🛠️\tCreating a table for {model.table_name}...')
710
model.up()
811

912
print('✅\tMigration is complete', end='\n\n')
1013

1114

12-
def down():
15+
def down() -> None:
1316
for model in reversed(models):
1417
print(f'🗑️\tDeleting a table with {model.table_name}...')
1518
model.down()
1619

1720
print('✅\tRollback is complete', end='\n\n')
1821

1922

20-
def reset():
23+
def reset() -> None:
2124
down()
2225
up()
2326

0 commit comments

Comments
 (0)