Closed Olegt0rr closed 3 years ago
I would like this feature too. In the mean time I'm using:
subprocess.check_output([*"poetry run aerich init-db".split()])
I'm calling it similar way, but can't apply it on apps with complex dynamic configuration.
By the way, you may change your list, asterisk and .split to shell=True
param :)
@long2ice I'm interested in this feature, so I'd like to take a crack at it. Do you think it is in the interest of the project? Do you think it would be difficult to do/maintain? I'd like to get a flow similar to what I had with django, where I can run migrations before my tests, from within the code.
There maybe much work to do, if you want you can give a try.
FYI: I figured that the reason I wanted to have migrations being run from inside the app is to have "system data" such as basic settings on my config table, so I wrote a very simple project called https://github.com/ekumenlabs/tortoise-data-migration
Please make ability to use
aerich
without CLII want to run it as an external library from my code