File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
piccolo/apps/migrations/commands Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
2+ from dataclasses import dataclass
23import datetime
34from itertools import chain
45import os
@@ -52,7 +53,16 @@ def _create_migrations_folder(migrations_path: str) -> bool:
5253 return True
5354
5455
55- async def _create_new_migration (app_config : AppConfig , auto = False ) -> None :
56+ @dataclass
57+ class NewMigrationMeta :
58+ migration_id : str
59+ migration_filename : str
60+ migration_path : str
61+
62+
63+ async def _create_new_migration (
64+ app_config : AppConfig , auto = False
65+ ) -> NewMigrationMeta :
5666 """
5767 Creates a new migration file on disk.
5868 """
@@ -105,6 +115,10 @@ async def _create_new_migration(app_config: AppConfig, auto=False) -> None:
105115 with open (path , "w" ) as f :
106116 f .write (file_contents )
107117
118+ return NewMigrationMeta (
119+ migration_id = _id , migration_filename = filename , migration_path = path
120+ )
121+
108122
109123###############################################################################
110124
You can’t perform that action at this time.
0 commit comments