File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ def __init__(self, engine):
1818 self .engine = engine
1919 self .queries = []
2020
21- def add (self , query ):
22- self .queries . append (query )
21+ def add (self , * query : str ):
22+ self .queries += list (query )
2323
2424 async def run (self ):
2525 connection = await asyncpg .connect (** self .engine .config )
Original file line number Diff line number Diff line change @@ -116,11 +116,6 @@ def _get_config() -> dict:
116116 return db
117117
118118
119- async def run_in_transaction (coroutine ):
120- # TODO .... wrap in transaction ...
121- await coroutine ()
122-
123-
124119@click .command ()
125120def forwards ():
126121 """
@@ -144,9 +139,7 @@ def forwards():
144139
145140 for _id in (set (ids ) - set (already_ran )):
146141 asyncio .run (
147- run_in_transaction (
148- MIGRATION_MODULES [_id ].forwards ()
149- )
142+ MIGRATION_MODULES [_id ].forwards ()
150143 )
151144
152145 print (f'Ran { _id } ' )
@@ -198,7 +191,9 @@ def backwards(migration_name: str):
198191 sys .exit (1 )
199192
200193 print (migration_name )
201- MIGRATION_MODULES [s ].backwards () # type: ignore
194+ asyncio .run (
195+ MIGRATION_MODULES [s ].backwards () # type: ignore
196+ )
202197
203198 Migration .delete ().where (
204199 Migration .name == s
You can’t perform that action at this time.
0 commit comments