Merge remote-tracking branch 'origin/main' into main-2

# Conflicts:
#	docs/SERVERS.md
This commit is contained in:
minaChoi committed 2026-10-12 16:26:01 +09:00
commit 840188e4ae
82 files changed
+4185 -78

No files matched your search

+37
View File
@@ -357,6 +357,34 @@ CREATE TABLE IF NOT EXISTS public.alert_outbox (
deleted BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE TABLE IF NOT EXISTS public.site_crawler_hits (
hit_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
site_id uuid NULL, -- robots·sitemap·없는 슬러그는 NULL
path TEXT NOT NULL,
kind VARCHAR(10) NOT NULL, -- page · robots · sitemap
bot VARCHAR(40) NULL, -- 목록 밖(other)이면 NULL
vendor VARCHAR(40) NULL,
purpose VARCHAR(20) NOT NULL, -- training · search · user-fetch · search-engine · other
user_agent TEXT NOT NULL,
ip VARCHAR(45) NULL, -- 목록 봇만(migrations/0024)
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
deleted BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE TABLE IF NOT EXISTS public.site_page_views (
view_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
site_id uuid NOT NULL,
path TEXT NOT NULL,
visitor_hash VARCHAR(64) NOT NULL, -- sha256(비밀값|IP|UA|KST 월), IP 원문 미저장(migrations/0025)
referrer_domain VARCHAR(255) NULL,
utm_source VARCHAR(100) NULL,
device VARCHAR(10) NOT NULL, -- desktop · mobile · tablet
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
deleted BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE TABLE IF NOT EXISTS public.place_posts (
post_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
place_id uuid NOT NULL,
@@ -584,6 +612,15 @@ CREATE INDEX IF NOT EXISTS ix_alert_outbox_pending ON public.alert_outbox (statu
CREATE INDEX IF NOT EXISTS ix_alert_outbox_dedupe ON public.alert_outbox (dedupe_key, created_at DESC)
WHERE dedupe_key IS NOT NULL;
-- site_crawler_hits — 사이트별 기간 조회 · 전체 기간 조회 · 봇별 조회(migrations/0024).
CREATE INDEX IF NOT EXISTS ix_site_crawler_hits_site ON public.site_crawler_hits (site_id, created_at);
CREATE INDEX IF NOT EXISTS ix_site_crawler_hits_created ON public.site_crawler_hits (created_at);
CREATE INDEX IF NOT EXISTS ix_site_crawler_hits_bot ON public.site_crawler_hits (bot, created_at);
-- site_page_views — 사이트별·전체 기간 조회(migrations/0025).
CREATE INDEX IF NOT EXISTS ix_site_page_views_site ON public.site_page_views (site_id, created_at);
CREATE INDEX IF NOT EXISTS ix_site_page_views_created ON public.site_page_views (created_at);
-- ============================================================
-- 마이그레이션 기준선(baseline)
-- ============================================================