mirror of
https://github.com/StepanovPlaton/torrent_backend.git
synced 2026-04-03 20:30:38 +04:00
Add requirements, cli commands. New project structure
This commit is contained in:
14
cli_commands.py
Normal file
14
cli_commands.py
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
from asyncio import run as aiorun
|
||||
import typer
|
||||
|
||||
import database
|
||||
|
||||
cli = typer.Typer()
|
||||
|
||||
@cli.command(name="create")
|
||||
def create_database(): aiorun(database.create_all())
|
||||
@cli.command(name="drop")
|
||||
def drop_database(): aiorun(database.drop_all())
|
||||
@cli.command(name="recreate")
|
||||
def recreate_database(): aiorun(database.recreate_all())
|
||||
Reference in New Issue
Block a user