add database downgrading

This commit is contained in:
2024-03-04 00:50:51 -05:00
parent bc2b883fa9
commit c4deff9d1c
2 changed files with 13 additions and 1 deletions

View File

@ -118,7 +118,13 @@ class Data:
def schema_upgrade(self, ver: str = None):
self.__alembic_cmd(
"upgrade",
"head",
"head" if not ver else ver,
)
def schema_downgrade(self, ver: str):
self.__alembic_cmd(
"downgrade",
ver,
)
async def create_owner(self, email: Optional[str] = None, code: Optional[str] = "00000000000000000000") -> None: