1
0
forked from Hay1tsme/artemis

dbutils: add create-revision command

This commit is contained in:
Hay1tsme 2024-01-11 20:48:27 -05:00
parent 19fd008598
commit fc3f0900b3
2 changed files with 15 additions and 0 deletions

View File

@ -219,3 +219,13 @@ class Data:
return True
async def create_revision(self, message: str) -> None:
if not message:
self.logger.info("Message is required for create-revision")
return
self.__alembic_cmd(
"revision",
"-m",
message,
)

View File

@ -21,6 +21,7 @@ if __name__ == "__main__":
)
parser.add_argument("--email", "-e", type=str, help="Email for the new user")
parser.add_argument("--access_code", "-a", type=str, help="Access code for new/transfer user", default="00000000000000000000")
parser.add_argument("--message", "-m", type=str, help="Revision message")
parser.add_argument("action", type=str, help="create, upgrade, create-owner")
args = parser.parse_args()
@ -56,5 +57,9 @@ if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(data.migrate())
elif args.action == "create-revision":
loop = asyncio.get_event_loop()
loop.run_until_complete(data.create_revision(args.message))
else:
logging.getLogger("database").info(f"Unknown action {args.action}")