From bba56e62efbc54c4d053ee085e7f3ccf13209631 Mon Sep 17 00:00:00 2001 From: Klaus Date: Tue, 9 Jun 2026 11:21:27 +0900 Subject: [PATCH] =?UTF-8?q?docs(ranking):=20=EC=8A=A4=EB=83=85=EC=83=B7=20?= =?UTF-8?q?job=20DDL=EC=9D=84=20=EC=B6=94=EA=B0=80=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-ranking-tables.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/20260608_크리에이터_랭킹/create-ranking-tables.sql b/docs/20260608_크리에이터_랭킹/create-ranking-tables.sql index a942a5ef..49d77902 100644 --- a/docs/20260608_크리에이터_랭킹/create-ranking-tables.sql +++ b/docs/20260608_크리에이터_랭킹/create-ranking-tables.sql @@ -39,3 +39,23 @@ create index idx_creator_ranking_snapshot_replace_period create index idx_creator_ranking_snapshot_period_creator on creator_ranking_snapshot (aggregation_start_at_utc, aggregation_end_at_utc, creator_id); + +create table creator_ranking_snapshot_job ( + id bigint not null auto_increment comment '크리에이터 랭킹 스냅샷 생성 job ID', + aggregation_start_at_utc timestamp not null comment '집계 시작 시각(UTC, 포함)', + aggregation_end_at_utc timestamp not null comment '집계 종료 시각(UTC, 미포함)', + trigger_type varchar(20) not null comment '실행 트리거(SCHEDULED, MANUAL)', + status varchar(20) not null comment 'job 상태(PENDING, PROCESSING, DONE, FAILED)', + last_error text null comment '마지막 실패 사유', + processing_started_at timestamp null comment '처리 시작 시각', + processed_at timestamp 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) +) engine=InnoDB default charset=utf8mb4 comment='크리에이터 랭킹 스냅샷 생성 job 이력'; + +create index idx_creator_ranking_snapshot_job_period_status + on creator_ranking_snapshot_job (aggregation_start_at_utc, aggregation_end_at_utc, status); + +create index idx_creator_ranking_snapshot_job_status_created_at + on creator_ranking_snapshot_job (status, created_at);