log inbound activity duration

This commit is contained in:
Hazelnoot 2024-11-18 01:18:45 -05:00
parent 07cd01ec34
commit e35e92beb9
3 changed files with 35 additions and 4 deletions

View file

@ -0,0 +1,19 @@
/*
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class ActivityLogTiming1731909785724 {
name = 'ActivityLogTiming1731909785724'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "activity_log" ADD "duration" double precision NOT NULL DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE "activity_log" ALTER COLUMN "result" DROP NOT NULL`);
}
async down(queryRunner) {
await queryRunner.query(`UPDATE "activity_log" SET "result" = 'not processed' WHERE "result" IS NULL`);
await queryRunner.query(`ALTER TABLE "activity_log" ALTER COLUMN "result" SET NOT NULL`);
await queryRunner.query(`ALTER TABLE "activity_log" DROP COLUMN "duration"`);
}
}