Skip to content

Commit

Permalink
Creating migration
Browse files Browse the repository at this point in the history
  • Loading branch information
TanookiVerde committed Jul 8, 2024
1 parent c81e0be commit ba075e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/migrations/app/19_20240708142702_update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
from tortoise import BaseDBAsyncClient


async def upgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "mrg__patientaddress" ADD "created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE "mrg__patientcns" ADD "created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE "mrg__patienttelecom" ADD "created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP;"""


async def downgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "mrg__patientcns" DROP COLUMN "created_at";
ALTER TABLE "mrg__patientaddress" DROP COLUMN "created_at";
ALTER TABLE "mrg__patienttelecom" DROP COLUMN "created_at";"""

0 comments on commit ba075e8

Please sign in to comment.