mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-04-29 18:16:58 +00:00
make activity_log.duration
nullable
This commit is contained in:
parent
15148b7875
commit
0979392925
2 changed files with 22 additions and 2 deletions
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class NullableActivityLogDuration1731935047347 {
|
||||||
|
name = 'NullableActivityLogDuration1731935047347'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TABLE "activity_log" ALTER COLUMN "duration" DROP NOT NULL`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "activity_log" ALTER COLUMN "duration" DROP DEFAULT`);
|
||||||
|
await queryRunner.query(`UPDATE "activity_log" SET "duration" = NULL WHERE "duration" = 0`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`UPDATE "activity_log" SET "duration" = 0 WHERE "duration" IS NULL`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "activity_log" ALTER COLUMN "duration" SET DEFAULT '0'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "activity_log" ALTER COLUMN "duration" SET NOT NULL`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,8 +23,8 @@ export class SkActivityLog {
|
||||||
/**
|
/**
|
||||||
* Processing duration in milliseconds
|
* Processing duration in milliseconds
|
||||||
*/
|
*/
|
||||||
@Column('double precision', { default: 0 })
|
@Column('double precision', { nullable: true })
|
||||||
public duration = 0;
|
public duration: number | null = null;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: 'text',
|
type: 'text',
|
||||||
|
|
Loading…
Add table
Reference in a new issue