Files
payphone/payphone/db/migrations/models/14_20250319193241_update.py
T

14 lines
523 B
Python

from tortoise import BaseDBAsyncClient
async def upgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "report" ADD "reported_by_id" BIGINT;
ALTER TABLE "report" ADD CONSTRAINT "fk_report_user_3a7d2f49" FOREIGN KEY ("reported_by_id") REFERENCES "user" ("id") ON DELETE CASCADE;"""
async def downgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "report" DROP CONSTRAINT IF EXISTS "fk_report_user_3a7d2f49";
ALTER TABLE "report" DROP COLUMN "reported_by_id";"""