페이지 섹션·공개 목록 설정 누적 변경 일괄 반영
페이지 섹션 관리와 홈 Pages 진열장 연동, 공개 목록 표시개수 설정 관련 누적 로컬 변경을 기능 단위로 정리해 반영한다. 문서 이력과 패키지 버전을 v1.9.23으로 맞춰 코드와 문서 상태를 동기화한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
13
db/migrations/060_page_listing_metadata.sql
Normal file
13
db/migrations/060_page_listing_metadata.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
ALTER TABLE pages
|
||||
ADD COLUMN IF NOT EXISTS is_listed BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN IF NOT EXISTS is_featured BOOLEAN NOT NULL DEFAULT false,
|
||||
ADD COLUMN IF NOT EXISTS listing_section TEXT NOT NULL DEFAULT '',
|
||||
ADD COLUMN IF NOT EXISTS listing_title TEXT NOT NULL DEFAULT '',
|
||||
ADD COLUMN IF NOT EXISTS listing_description TEXT NOT NULL DEFAULT '',
|
||||
ADD COLUMN IF NOT EXISTS listing_sort_order INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS pages_listing_public_idx
|
||||
ON pages (is_listed, status, listing_section ASC, listing_sort_order ASC, updated_at DESC);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS pages_featured_public_idx
|
||||
ON pages (is_featured, status, listing_sort_order ASC, updated_at DESC);
|
||||
18
db/migrations/061_page_listing_sections.sql
Normal file
18
db/migrations/061_page_listing_sections.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE IF NOT EXISTS page_listing_sections (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
sort_order INTEGER NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
INSERT INTO page_listing_sections (name, sort_order)
|
||||
SELECT DISTINCT
|
||||
trim(listing_section) AS name,
|
||||
dense_rank() OVER (ORDER BY trim(listing_section)) * 10 AS sort_order
|
||||
FROM pages
|
||||
WHERE trim(COALESCE(listing_section, '')) <> ''
|
||||
ON CONFLICT (name) DO NOTHING;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS page_listing_sections_sort_order_name_idx
|
||||
ON page_listing_sections (sort_order ASC, name ASC);
|
||||
46
db/migrations/062_site_settings_display_counts.sql
Normal file
46
db/migrations/062_site_settings_display_counts.sql
Normal file
@@ -0,0 +1,46 @@
|
||||
ALTER TABLE site_settings
|
||||
ADD COLUMN IF NOT EXISTS home_latest_post_limit INTEGER NOT NULL DEFAULT 20,
|
||||
ADD COLUMN IF NOT EXISTS post_list_page_size INTEGER NOT NULL DEFAULT 20,
|
||||
ADD COLUMN IF NOT EXISTS tag_post_list_page_size INTEGER NOT NULL DEFAULT 20,
|
||||
ADD COLUMN IF NOT EXISTS featured_post_limit INTEGER NOT NULL DEFAULT 6,
|
||||
ADD COLUMN IF NOT EXISTS page_section_item_limit INTEGER NOT NULL DEFAULT 12;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
ADD CONSTRAINT site_settings_home_latest_post_limit_range_check
|
||||
CHECK (home_latest_post_limit BETWEEN 1 AND 50)
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
ADD CONSTRAINT site_settings_post_list_page_size_range_check
|
||||
CHECK (post_list_page_size BETWEEN 1 AND 50)
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
ADD CONSTRAINT site_settings_tag_post_list_page_size_range_check
|
||||
CHECK (tag_post_list_page_size BETWEEN 1 AND 50)
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
ADD CONSTRAINT site_settings_featured_post_limit_range_check
|
||||
CHECK (featured_post_limit BETWEEN 1 AND 50)
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
ADD CONSTRAINT site_settings_page_section_item_limit_range_check
|
||||
CHECK (page_section_item_limit BETWEEN 1 AND 50)
|
||||
NOT VALID;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
VALIDATE CONSTRAINT site_settings_home_latest_post_limit_range_check;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
VALIDATE CONSTRAINT site_settings_post_list_page_size_range_check;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
VALIDATE CONSTRAINT site_settings_tag_post_list_page_size_range_check;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
VALIDATE CONSTRAINT site_settings_featured_post_limit_range_check;
|
||||
|
||||
ALTER TABLE site_settings
|
||||
VALIDATE CONSTRAINT site_settings_page_section_item_limit_range_check;
|
||||
Reference in New Issue
Block a user