Skip to content

Commit 0ffae7e

Browse files
feat(cron): add task description
1 parent b4b54ac commit 0ffae7e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

microservices/cron/migrations/1676285930026-init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default class init1676285930026 implements MigrationInterface {
1111
`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"))`,
1212
);
1313
await queryRunner.query(
14-
`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, "payload" json NOT NULL DEFAULT '{}', "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "task(pk):id" PRIMARY KEY ("id"))`,
14+
`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"))`,
1515
);
1616
await queryRunner.query(
1717
`ALTER TABLE "history" ADD CONSTRAINT "history(fk):taskId_id" FOREIGN KEY ("taskId") REFERENCES "task"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,

microservices/cron/src/entities/task.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class Task {
3131
@Length(1, 100)
3232
method: string;
3333

34+
@Column({ type: 'varchar', length: 255, default: '' })
35+
@Length(0, 255)
36+
@IsUndefinable()
37+
description: string;
38+
3439
@JSONSchema({
3540
description: 'Request params and options',
3641
})

0 commit comments

Comments
 (0)