-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from prefeitura-rio/development
Merge pull request #150 from prefeitura-rio/main
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
from tortoise import BaseDBAsyncClient | ||
|
||
|
||
async def upgrade(db: BaseDBAsyncClient) -> str: | ||
return """ | ||
ALTER TABLE "datasource" ALTER COLUMN "system" TYPE VARCHAR(50) USING "system"::VARCHAR(50); | ||
ALTER TABLE "raw__encounter" ALTER COLUMN "source_id" TYPE VARCHAR(100) USING "source_id"::VARCHAR(100);""" | ||
|
||
|
||
async def downgrade(db: BaseDBAsyncClient) -> str: | ||
return """ | ||
ALTER TABLE "datasource" ALTER COLUMN "system" TYPE VARCHAR(50) USING "system"::VARCHAR(50); | ||
ALTER TABLE "raw__encounter" ALTER COLUMN "source_id" TYPE TIMESTAMPTZ USING "source_id"::TIMESTAMPTZ;""" |