From b624b5398e62380274471c0533df69a82ac85add Mon Sep 17 00:00:00 2001 From: Upstream Data Date: Wed, 11 Sep 2024 08:16:18 -0600 Subject: [PATCH] Migrate DB schemas Adds migration for DB to add new values. --- .../models/1_20240911081506_add_image_format.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 goosebit/db/migrations/models/1_20240911081506_add_image_format.py diff --git a/goosebit/db/migrations/models/1_20240911081506_add_image_format.py b/goosebit/db/migrations/models/1_20240911081506_add_image_format.py new file mode 100644 index 00000000..731e341c --- /dev/null +++ b/goosebit/db/migrations/models/1_20240911081506_add_image_format.py @@ -0,0 +1,11 @@ +from tortoise import BaseDBAsyncClient + + +async def upgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE "software" ADD "image_format" SMALLINT NOT NULL DEFAULT 0 /* SWU: 0\nRAUC: 1 */;""" + + +async def downgrade(db: BaseDBAsyncClient) -> str: + return """ + ALTER TABLE "software" DROP COLUMN "image_format";"""