14 lines
523 B
Python
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";"""
|