관리자 기능과 태그 표시 설정 추가

This commit is contained in:
2026-05-01 18:00:22 +09:00
parent 237eb2990f
commit 787747aa7f
51 changed files with 2261 additions and 128 deletions

View File

@@ -32,10 +32,21 @@ CREATE TABLE IF NOT EXISTS tags (
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT NOT NULL DEFAULT '',
sort_order INTEGER NOT NULL DEFAULT 0,
color TEXT NOT NULL DEFAULT '#15171a',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
ALTER TABLE tags
ADD COLUMN IF NOT EXISTS sort_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE tags
ADD COLUMN IF NOT EXISTS color TEXT NOT NULL DEFAULT '#15171a';
CREATE INDEX IF NOT EXISTS tags_sort_order_name_idx
ON tags (sort_order ASC, name ASC);
CREATE TABLE IF NOT EXISTS post_tags (
post_id UUID NOT NULL REFERENCES posts(id) ON DELETE CASCADE,
tag_id UUID NOT NULL REFERENCES tags(id) ON DELETE CASCADE,

View File

@@ -1,7 +1,7 @@
INSERT INTO tags (id, name, slug, description)
INSERT INTO tags (id, name, slug, description, sort_order, color)
VALUES
('44444444-4444-4444-8444-444444444444', 'NOTE', 'note', '생각과 기록을 모아두는 태그입니다.'),
('55555555-5555-4555-8555-555555555555', 'DEV', 'dev', '개발과 제작 과정을 기록하는 태그입니다.')
('44444444-4444-4444-8444-444444444444', 'NOTE', 'note', '생각과 기록을 모아두는 태그입니다.', 10, '#f97316'),
('55555555-5555-4555-8555-555555555555', 'DEV', 'dev', '개발과 제작 과정을 기록하는 태그입니다.', 20, '#06b6d4')
ON CONFLICT (slug) DO NOTHING;
INSERT INTO posts (

View File

@@ -0,0 +1,18 @@
ALTER TABLE tags
ADD COLUMN IF NOT EXISTS sort_order INTEGER NOT NULL DEFAULT 0;
ALTER TABLE tags
ADD COLUMN IF NOT EXISTS color TEXT NOT NULL DEFAULT '#15171a';
UPDATE tags
SET sort_order = 10,
color = '#f97316'
WHERE slug = 'note';
UPDATE tags
SET sort_order = 20,
color = '#06b6d4'
WHERE slug = 'dev';
CREATE INDEX IF NOT EXISTS tags_sort_order_name_idx
ON tags (sort_order ASC, name ASC);