From d86fee09457c29d253450b02193143147c796153 Mon Sep 17 00:00:00 2001 From: Klaus Date: Mon, 1 Jun 2026 18:29:46 +0900 Subject: [PATCH] =?UTF-8?q?docs(home):=20=ED=99=88=20=EC=B6=94=EC=B2=9C=20?= =?UTF-8?q?=EC=8B=A0=EA=B7=9C=20=ED=85=8C=EC=9D=B4=EB=B8=94=20SQL=20?= =?UTF-8?q?=EC=84=A4=EB=AA=85=EC=9D=84=20=EB=B3=B4=EA=B0=95=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-new-entity-tables.sql | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/20260529_메인_홈_추천_API/create-new-entity-tables.sql b/docs/20260529_메인_홈_추천_API/create-new-entity-tables.sql index e0abc1da..6bfad3d1 100644 --- a/docs/20260529_메인_홈_추천_API/create-new-entity-tables.sql +++ b/docs/20260529_메인_홈_추천_API/create-new-entity-tables.sql @@ -1,27 +1,27 @@ create table recommendation_snapshot ( - id bigint not null auto_increment, - created_at datetime(6) null, - updated_at datetime(6) null, - section_type varchar(50) not null, - target_id bigint not null, - score double not null, - snapshot_at datetime(6) not null, - random_tie_breaker double not null, + id bigint not null auto_increment comment 'ID', + section_type varchar(50) not null comment '섹션 타입', + target_id bigint not null comment '대상 ID', + score double not null comment '점수', + snapshot_at TIMESTAMP not null comment '스냅샷 시각', + random_tie_breaker double not null comment '랜덤 타이 브레이커', + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 시각', + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 시각', primary key (id), index idx_recommendation_snapshot_latest (section_type, snapshot_at, score, random_tie_breaker), index idx_recommendation_snapshot_target (section_type, target_id) -); +) comment '추천 스냅샷'; create table creator_content_view_history ( - id bigint not null auto_increment, - created_at datetime(6) null, - updated_at datetime(6) null, - member_id bigint not null, - content_id bigint not null, - genre_id bigint not null, - viewed_at datetime(6) not null, + id bigint not null auto_increment comment 'ID', + member_id bigint not null comment '회원 ID', + content_id bigint not null comment '콘텐츠 ID', + genre_id bigint not null comment '장르 ID', + viewed_at TIMESTAMP not null comment '시청 시각', + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 시각', + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 시각', primary key (id), index idx_creator_content_view_history_member_viewed (member_id, viewed_at), index idx_creator_content_view_history_content (content_id), index idx_creator_content_view_history_genre (genre_id) -); +) comment '크리에이터 콘텐츠 시청 이력';