diff --git a/src/batch/task.service.ts b/src/batch/task.service.ts index 3531597..038f882 100644 --- a/src/batch/task.service.ts +++ b/src/batch/task.service.ts @@ -37,7 +37,7 @@ export class TaskService { }); const contents = await this.contents.find({ where: { - deadline: utcToday, + reminder: utcToday, }, relations: { user: true, diff --git a/src/contents/contents.service.ts b/src/contents/contents.service.ts index 44b2a7f..3b5a980 100644 --- a/src/contents/contents.service.ts +++ b/src/contents/contents.service.ts @@ -62,7 +62,7 @@ export class ContentsService { link, title, comment, - deadline, + reminder, favorite, categoryName, parentId, @@ -113,7 +113,7 @@ export class ContentsService { coverImg, description, comment, - deadline, + reminder, ...(category && { category }), user, ...(favorite && { favorite }), @@ -196,7 +196,7 @@ export class ContentsService { title, description, comment, - deadline, + reminder, favorite, categoryName, parentId, @@ -208,7 +208,7 @@ export class ContentsService { title, description, comment, - deadline, + reminder, favorite, }; try { diff --git a/src/contents/dtos/content.dto.ts b/src/contents/dtos/content.dto.ts index 1da84fd..c4a56b9 100644 --- a/src/contents/dtos/content.dto.ts +++ b/src/contents/dtos/content.dto.ts @@ -9,7 +9,7 @@ import { CoreOutput } from '../../common/dtos/output.dto'; import { Content } from '../entities/content.entity'; class ContentBodyExceptLink extends PartialType( - PickType(Content, ['title', 'comment', 'deadline', 'favorite']), + PickType(Content, ['title', 'comment', 'reminder', 'favorite']), ) { @ApiProperty({ description: 'Category Name', required: false }) @IsString() diff --git a/src/contents/entities/content.entity.ts b/src/contents/entities/content.entity.ts index 2faee7b..46069a9 100644 --- a/src/contents/entities/content.entity.ts +++ b/src/contents/entities/content.entity.ts @@ -50,14 +50,14 @@ export class Content extends CoreEntity { @ApiProperty({ example: '2022-08-20', - description: 'Article Deadline(YYYY-MM-DD HH:mm:ss)', + description: 'Article Reminder Date(YYYY-MM-DD HH:mm:ss)', required: false, }) @Column({ nullable: true }) @IsDate() @IsOptional() @Transform(({ value }) => new Date(value)) - deadline?: Date; + reminder?: Date; @ApiProperty({ description: 'Favorite' }) @Column({ default: false }) diff --git a/src/database/migrations/1678797251031-update-read-deadline-name-to-reminder.ts b/src/database/migrations/1678797251031-update-read-deadline-name-to-reminder.ts new file mode 100644 index 0000000..aa2502b --- /dev/null +++ b/src/database/migrations/1678797251031-update-read-deadline-name-to-reminder.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class updateReadDeadlineNameToReminder1678797251031 implements MigrationInterface { + name = 'updateReadDeadlineNameToReminder1678797251031' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "content" RENAME COLUMN "deadline" TO "reminder"`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "content" RENAME COLUMN "reminder" TO "deadline"`); + } + +}