Skip to content

Commit 8053e48

Browse files
fix(cron): execution time column type
1 parent 88f889f commit 8053e48

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

microservices/cron/migrations/1676285930026-init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class init1676285930026 implements MigrationInterface {
88
`CREATE TYPE "public"."history_status_enum" AS ENUM('running', 'error', 'success')`,
99
);
1010
await queryRunner.query(
11-
`CREATE TABLE "history" ("id" SERIAL NOT NULL, "taskId" integer NOT NULL, "status" "public"."history_status_enum" NOT NULL, "response" json NOT NULL DEFAULT '{}', "executionTime" integer, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "history(pk):id" PRIMARY KEY ("id"))`,
11+
`CREATE TABLE "history" ("id" SERIAL NOT NULL, "taskId" integer NOT NULL, "status" "public"."history_status_enum" NOT NULL, "response" json NOT NULL DEFAULT '{}', "executionTime" numeric(6,2) NOT NULL DEFAULT 0, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "history(pk):id" PRIMARY KEY ("id"))`,
1212
);
1313
await queryRunner.query(
1414
`CREATE TABLE "task" ("id" SERIAL NOT NULL, "nodeId" character varying(50) NOT NULL DEFAULT 'node1', "rule" character varying(50) NOT NULL, "method" character varying(100) NOT NULL, "description" character varying(255) NOT NULL DEFAULT '', "payload" json NOT NULL DEFAULT '{}', "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "task(pk):id" PRIMARY KEY ("id"))`,

microservices/cron/src/entities/history.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class History {
3333
@IsUndefinable()
3434
response: Record<string, any>;
3535

36-
@Column({ type: 'integer', default: null })
36+
@Column({ type: 'decimal', precision: 6, scale: 2, default: 0 })
3737
@IsNumber()
3838
@IsUndefinable()
3939
executionTime: number;

0 commit comments

Comments
 (0)