[refactor] postgres-init,solution: DB 구조 재편 — 스키마 해체 · 공용 콘텐츠 한 벌 · 마이그레이션 체계

도메인별 스키마(company·place·fact·local·site·job)를 걷어내고 public 한 벌로 폈다.
스키마 한정자가 붙은 순간부터 ORM·raw SQL·테스트 픽스처가 각자 그 이름을 들고 다녀야 했다.

- 공용 콘텐츠를 한 테이블로 되돌린다. spots·region_stories 를 따로 파 놓고 보니
  같은 성격이 세 곳으로 갈라져 있었다 — `area_contents` 가 처음부터 content_type 으로
  종류를 가르는 설계였고 그걸 쓰면 됐다. 관계(거리·숨김)만 `place_area_refs` 로 남긴다.
- migrations/ + scripts/migrate.py: `init.sql` 은 **DB 를 처음 만들 때만** 돈다. 파일에
  컬럼을 더해도 이미 데이터가 든 DB 에는 반영되지 않는다 — 실제로 TourAPI 가 주변 정보를
  받아 와도 저장할 곳이 없어 축제·맛집이 0건이었고, 화면에는 "그냥 안 나오는 것" 으로만 보였다.
  DECISIONS.md 가 예고한 그대로다("운영 DB 가 생기는 순간 다시 필요해진다").
  Alembic 을 쓰지 않는 이유는 스키마 정의가 이미 두 곳(ORM·init.sql)이라 세 번째를
  더하면 어긋날 자리가 하나 더 생기기 때문이다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 5 committed 2026-09-09 17:08:02 +09:00
1 parent 7bbeb068a8
commit 64ce467f21
189 files changed
+13374 -5023

No files matched your search

+25 -42
View File
@@ -1,5 +1,6 @@
import {useSite} from '@/lib/site-context';
import {faqList} from '@/lib/derive';
import {Section} from '@/lib/ui';
/**
* FAQ.
@@ -8,6 +9,8 @@ import {faqList} from '@/lib/derive';
* 닫힌 답변이 DOM 에 없거나 hidden 이라, 크롤러가 못 읽는 일이 생긴다.
* 네이티브 details 는 닫혀 있어도 내용이 문서에 있고, 검색·AI 가 그대로 읽는다.
* FAQPage 구조화 데이터와 화면 텍스트가 같아야 하는 규칙도 이 방식이라야 지켜진다.
*
* ★ 질문이 많으면 두 단으로 흘린다. 한 줄로 세우면 FAQ 만으로 화면 세 개가 넘어간다.
*/
export function FaqSection() {
const payload = useSite();
@@ -16,51 +19,31 @@ export function FaqSection() {
if (faqs.length === 0) return null;
return (
<section
<Section
id="faq"
aria-labelledby="faq-heading"
className="border-line paper w-full border-b"
style={{backgroundColor: 'var(--tpl-surface-alt, #f5f5f4)', paddingBlock: 'var(--section-space)'}}
tone="alt"
title="자주 묻는 질문"
lead="아래 답변은 모두 사업자가 확인한 내용입니다."
>
<div className="shell">
<div>
<header className="mb-6 sm:mb-8">
<div className="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between sm:gap-6">
<div className="min-w-0">
<h2 id="faq-heading" className="h2 flex items-center gap-2.5">
<i aria-hidden="true" className="h-[1em] w-[3px] shrink-0 bg-current opacity-25" />
<span className="min-w-0">자주 묻는 질문</span>
</h2>
<p className="text-muted measure mt-2 pl-[calc(3px+0.625rem)] text-[length:var(--fs-sm)]">
아래 답변은 모두 사업자가 확인한 내용입니다.
</p>
</div>
<div className={faqs.length > 4 ? 'grid gap-3 lg:grid-cols-2 lg:gap-4' : 'space-y-3'}>
{faqs.map((faq, index) => (
<details
key={faq.faqId}
// 첫 항목만 펼쳐 둔다 — 나머지도 DOM 에는 그대로 있다.
open={index === 0}
className="panel group h-fit overflow-hidden"
>
<summary className="tap flex cursor-pointer items-center gap-3 px-5 text-[length:var(--fs-sm)] font-bold marker:content-none [&::-webkit-details-marker]:hidden">
<span className="serif text-muted shrink-0">Q.</span>
<span className="flex-1">{faq.question}</span>
<span className="text-muted shrink-0 transition-transform group-open:rotate-45">+</span>
</summary>
<div className="border-line border-t px-5 pb-5 pt-4 text-[length:var(--fs-sm)] leading-relaxed opacity-80">
{faq.answer}
</div>
</header>
</div>
{/* ★ 두 칸으로 편다. 한 줄로 세우면 질문 열 개가 화면 두 개를 잡아먹는다.
`h-fit` 이라 펼친 카드만 길어지고 옆 카드는 따라 늘어나지 않는다. */}
<div className="grid gap-3 lg:grid-cols-2 lg:gap-4">
{faqs.map((faq, index) => (
<details
key={faq.faqId}
// 첫 항목만 펼쳐 둔다 — 나머지도 DOM 에는 그대로 있다.
open={index === 0}
className="panel group h-fit overflow-hidden"
>
<summary className="tap flex cursor-pointer items-center gap-3 px-5 text-[length:var(--fs-sm)] font-bold marker:content-none [&::-webkit-details-marker]:hidden">
<span className="serif text-muted shrink-0">Q.</span>
<span className="flex-1">{faq.question}</span>
<span className="text-muted shrink-0 transition-transform group-open:rotate-45">+</span>
</summary>
<div className="border-line border-t px-5 pb-5 pt-4 text-[length:var(--fs-sm)] leading-relaxed opacity-80">
{faq.answer}
</div>
</details>
))}
</div>
</details>
))}
</div>
</section>
</Section>
);
}