Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/life/mosu/mosuserver/domain/file/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public abstract class File {

@Column
private String fileName;

@Column
@Column(columnDefinition = "TEXT")

Choose a reason for hiding this comment

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

medium

Using columnDefinition = "TEXT" is specific to certain databases like MySQL or PostgreSQL and can harm database portability. For better portability and to adhere to JPA standards for large string fields, it's recommended to use the @Lob annotation instead. This will map to the appropriate large object type for the target database (e.g., TEXT, CLOB). You will need to add import jakarta.persistence.Lob;.

Suggested change
@Column(columnDefinition = "TEXT")
@Lob

private String s3Key;

@Enumerated(EnumType.STRING)
Expand Down
60 changes: 60 additions & 0 deletions src/main/resources/db/data/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.931747', '2025-08-03 05:01:17.931747', '강남구 대치동 987', '서울특별시',
'06234', 'DAECHI', 532, '2025-10-12 23:59:59.000000', '2025-10-19', '고정 도시락', 9000, '대치중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.939018', '2025-08-03 05:01:17.939018', '양천구 목동서로 369', '서울특별시',
'07995', 'MOKDONG', 896, '2025-10-19 23:59:59.000000', '2025-10-26', '고정 도시락', 9000,
'목운중학교', false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.945445', '2025-08-03 05:01:17.945445', '양천구 신정로 250', '서울특별시',
'08018', 'MOKDONG', 896, '2025-10-26 23:59:59.000000', '2025-11-02', '고정 도시락', 9000,
'신서중학교', false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.952291', '2025-08-03 05:01:17.952291', '강남구 개포로 619', '서울특별시',
'06327', 'DAECHI', 840, '2025-10-19 23:59:59.000000', '2025-10-26', '고정 도시락', 9000, '개원중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.958425', '2025-08-03 05:01:17.958425', '강남구 개포로 619', '서울특별시',
'06327', 'DAECHI', 840, '2025-10-26 23:59:59.000000', '2025-11-02', '고정 도시락', 9000, '개원중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.965381', '2025-08-03 05:01:17.965381', '영등포구 문래로 195', '서울특별시',
'07291', 'MOKDONG', 558, '2025-10-12 23:59:59.000000', '2025-10-19', '고정 도시락', 9000,
'문래중학교', false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.972408', '2025-08-03 05:01:17.972408', '노원구 덕릉로 70길 99', '서울특별시',
'01673', 'NOWON', 448, '2025-10-12 23:59:59.000000', '2025-10-19', '고정 도시락', 9000, '온곡중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.978612', '2025-08-03 05:01:17.978612', '노원구 덕릉로 70길 99', '서울특별시',
'01673', 'NOWON', 448, '2025-10-26 23:59:59.000000', '2025-11-02', '고정 도시락', 9000, '온곡중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.982574', '2025-08-03 05:01:17.982574', '대구광역시 달서구 장기로 76', '서울특별시',
'42677', 'DAEGU', 392, '2025-10-12 23:59:59.000000', '2025-10-19', '고정 도시락', 9000, '노변중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.988270', '2025-08-03 05:01:17.988270', '대구광역시 달서구 장기로 76', '서울특별시',
'42677', 'DAEGU', 392, '2025-10-26 23:59:59.000000', '2025-11-02', '고정 도시락', 9000, '노변중학교',
false, 'OPEN');
Comment on lines +52 to +60

Choose a reason for hiding this comment

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

high

The address data for '노변중학교' in these two INSERT statements seems incorrect. The detail address is in Daegu ('대구광역시 달서구 장기로 76'), but the street is listed as '서울특별시' (Seoul). This should probably be '대구광역시' for consistency.

Suggested change
VALUES ('2025-08-03 05:01:17.982574', '2025-08-03 05:01:17.982574', '대구광역시 달서구 장기로 76', '서울특별시',
'42677', 'DAEGU', 392, '2025-10-12 23:59:59.000000', '2025-10-19', '고정 도시락', 9000, '노변중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.988270', '2025-08-03 05:01:17.988270', '대구광역시 달서구 장기로 76', '서울특별시',
'42677', 'DAEGU', 392, '2025-10-26 23:59:59.000000', '2025-11-02', '고정 도시락', 9000, '노변중학교',
false, 'OPEN');
VALUES ('2025-08-03 05:01:17.982574', '2025-08-03 05:01:17.982574', '대구광역시 달서구 장기로 76', '대구광역시',
'42677', 'DAEGU', 392, '2025-10-12 23:59:59.000000', '2025-10-19', '고정 도시락', 9000, '노변중학교',
false, 'OPEN');
INSERT INTO sa.exam (created_at, updated_at, detail, street, zipcode, area, capacity,
deadline_time, exam_date, lunch_name, lunch_price, school_name, deleted,
exam_status)
VALUES ('2025-08-03 05:01:17.988270', '2025-08-03 05:01:17.988270', '대구광역시 달서구 장기로 76', '대구광역시',
'42677', 'DAEGU', 392, '2025-10-26 23:59:59.000000', '2025-11-02', '고정 도시락', 9000, '노변중학교',
false, 'OPEN');

Comment on lines +1 to +60

Choose a reason for hiding this comment

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

medium

This new data.sql file seems to duplicate the data initialization logic already present in DatabaseInitializer.java. Having two separate mechanisms for seeding data can lead to inconsistencies and increased maintenance effort. It's recommended to have a single source of truth for initial data. If this SQL file is the new standard, consider removing DatabaseInitializer.java.

Comment on lines +1 to +60

Choose a reason for hiding this comment

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

medium

For better performance and readability, you can combine all INSERT statements into a single one with multiple VALUES clauses. This reduces network overhead and is generally faster for the database to process.

Example:

INSERT INTO sa.exam (created_at, updated_at, ...) VALUES
    ('...', '...', ...),
    ('...', '...', ...);