Skip to content

feat: increase question content length/#701#702

Merged
hjbin-25 merged 2 commits into
developfrom
feat/increase-question-content-length/#701
Apr 24, 2026
Merged

feat: increase question content length/#701#702
hjbin-25 merged 2 commits into
developfrom
feat/increase-question-content-length/#701

Conversation

@chaeyn

@chaeyn chaeyn commented Apr 24, 2026

Copy link
Copy Markdown
Member

변경사항

  • mission의 content를 최대 2000자까지 입력 가능하도록 변경했습니다.

관련 이슈

Closes #701

추가 컨텍스트

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the character limit for the question content field from 1000 to 2000 characters, updating the database migration, JPA entity, DTOs, and Swagger documentation, while adding corresponding validation tests. The review feedback recommends consistently increasing the length of the explanation field as well, suggesting updates to the JPA entity, DTO validation, and the SQL migration script to prevent potential data truncation or validation errors.

Comment on lines +35 to 38
@Column(nullable = false, length = 2000)
private String content;

private String explanation;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

질문 내용(content)의 최대 길이를 2000자로 늘린 것과 대조적으로, 해설(explanation) 필드는 별도의 길이 설정이 없어 기본값인 255자로 제한될 가능성이 큽니다. 질문 내용이 길어지면 그에 따른 해설도 길어질 확률이 높으므로, explanation 필드의 길이도 함께 늘리는 것을 권장합니다.

Suggested change
@Column(nullable = false, length = 2000)
private String content;
private String explanation;
@Column(nullable = false, length = 2000)
private String content;
@Column(length = 2000)
private String explanation;

Comment on lines 17 to 21
@NotBlank(message = "content는 필수 입력값입니다.")
@Size(max = 2000, message = "content는 최대 2000자까지 입력할 수 있습니다.")
String content,

String explanation,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

DB와 엔티티의 변경 사항에 맞춰 DTO에서도 explanation 필드에 대한 @SiZe 검증을 추가하는 것이 안전합니다. 검증이 없으면 DB 저장 시점에 예외가 발생할 수 있습니다.

Suggested change
@NotBlank(message = "content는 필수 입력값입니다.")
@Size(max = 2000, message = "content는 최대 2000자까지 입력할 수 있습니다.")
String content,
String explanation,
@NotBlank(message = "content는 필수 입력값입니다.")
@Size(max = 2000, message = "content는 최대 2000자까지 입력할 수 있습니다.")
String content,
@Size(max = 2000, message = "explanation은 최대 2000자까지 입력할 수 있습니다.")
String explanation,

Comment on lines 14 to 18
@NotBlank(message = "content는 필수 입력값입니다.")
@Size(max = 2000, message = "content는 최대 2000자까지 입력할 수 있습니다.")
String content,

String explanation,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

수정 DTO에서도 explanation 필드에 대한 최대 길이 검증을 추가하여 런타임 에러를 방지하는 것이 좋습니다.

Suggested change
@NotBlank(message = "content는 필수 입력값입니다.")
@Size(max = 2000, message = "content는 최대 2000자까지 입력할 수 있습니다.")
String content,
String explanation,
@NotBlank(message = "content는 필수 입력값입니다.")
@Size(max = 2000, message = "content는 최대 2000자까지 입력할 수 있습니다.")
String content,
@Size(max = 2000, message = "explanation은 최대 2000자까지 입력할 수 있습니다.")
String explanation,

Comment on lines +1 to +2
ALTER TABLE questions_v2
ALTER COLUMN content TYPE VARCHAR(2000); No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

content 컬럼의 길이를 늘릴 때 explanation 컬럼의 길이도 함께 늘리는 것을 권장합니다. 질문 내용이 길어지면 해설 또한 기본 VARCHAR 길이(255)를 초과할 가능성이 높기 때문입니다.

ALTER TABLE questions_v2
    ALTER COLUMN content TYPE VARCHAR(2000),
    ALTER COLUMN explanation TYPE VARCHAR(2000);

@hjbin-25 hjbin-25 merged commit 81a01cd into develop Apr 24, 2026
1 check passed
@hjbin-25 hjbin-25 deleted the feat/increase-question-content-length/#701 branch April 24, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants