[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

+42 -26
View File
@@ -1,26 +1,48 @@
import {ChevronDown, MapPin} from 'lucide-react';
import {useSite} from '@/lib/site-context';
import {primaryImage} from '@/seo/meta';
import {unitSpec} from '@/lib/derive';
import {bookingLinks, unitSpec} from '@/lib/derive';
import {HeroPension} from './HeroPension';
import {HeroSplit} from './HeroSplit';
import {useLayout} from '@/lib/layout';
import {Hero as ReservationHero} from '@/layouts/reservation/Hero';
import {Hero as OasiHero} from '@/layouts/oasi/Hero';
import {Hero as StudioHero} from '@/layouts/studio/Hero';
import {Hero as PastelHero} from '@/layouts/pastel/Hero';
import {Hero as EditorialHero} from '@/layouts/editorial/Hero';
/**
* 첫 화면.
*
* ★ 가운데 정렬이 아니라 **좌하단**이다. 사진이 주인공인 화면에서 글자를 한가운데 얹으면
* 사진의 피사체를 정확히 가린다 — 실제로 그 이유로 좌하단으로 내렸다(/s/stay).
* ★ 색은 전부 템플릿 토큰이다. 여기에 zinc-950 같은 고정색을 쓰면 레트로(갱지)를 골라도
* 첫 화면만 검게 남는다.
* ★ 버튼을 두 개 세우지 않는다. 첫 화면에서 물어볼 것은 "방을 보겠는가" 하나다.
* ★ 사진 아래 값 띠를 뺐다 (2026-09-03, 사장님 지적)
* 최저가·체크인/아웃·주차를 띠로 깔았는데, **바로 아래 '예약 전 확인'(AnswerBlock)이
* 같은 값을 그대로 다시 낸다.** 한 화면에서 같은 숫자가 두 번 나오면 둘 다 값어치가 떨어지고,
* 첫 화면이 사진이 아니라 표로 시작한다.
* ★ 색을 박지 않는다. 예전에는 `bg-zinc-950` 이라 어떤 템플릿을 골라도 첫 화면만 검정이었다.
* ★ 높이를 vh 하나로 잡지 않는다. 모바일 주소창이 접혔다 펴질 때 100vh 가 출렁여 글자가 뛴다.
*/
export function HeroSection() {
const payload = useSite();
// ★ 첫 화면의 골격은 템플릿이 정한다. 색만 바꾸는 건 안이 아니다 —
// 펜션형(hero.slideshow)은 사진이 화면을 꽉 채우고 저절로 넘어간다.
// 레이아웃이 제 첫 화면을 가지고 있으면 그것이 우선이다 — 템플릿의 얼굴이다.
const layout = useLayout();
if (layout === 'reservation') return <ReservationHero />;
if (layout === 'oasi') return <OasiHero />;
if (layout === 'studio') return <StudioHero />;
if (layout === 'pastel') return <PastelHero />;
if (layout === 'editorial') return <EditorialHero />;
const heroVariant = payload.theme.sections.find((s) => s.id === 'hero')?.variantId;
if (heroVariant === 'hero.slideshow') return <HeroPension />;
if (heroVariant === 'hero.split') return <HeroSplit />;
const {place, narrative} = payload;
const image = primaryImage(payload);
const spec = unitSpec(payload);
const region = place.addressLocality ?? place.addressRegion;
const subline = narrative.tagline ?? narrative.heroSubline;
const links = bookingLinks(payload);
const locality = place.addressLocality ?? place.addressRegion;
// id="top" — 상단 로고와 하단 탭의 '홈' 이 여기로 돌아온다.
// id="top" — 상단 로고와 하단 바의 '홈' 이 여기로 돌아온다.
return (
<section id="top" className="w-full">
<div
@@ -43,23 +65,22 @@ export function HeroSection() {
height={image.height}
className="size-full object-cover object-center"
/>
{/* 글자가 놓이는 아래쪽만 짙게. 위쪽은 사진을 그대로 보여준다. */}
{/* 글자가 놓이는 아래쪽만 덮는다. 고르게 덮으면 사진이 통째로 탁해진다. */}
<div
className="absolute inset-0"
style={{
background:
'linear-gradient(to top, color-mix(in srgb, var(--tpl-inverse, #1c1917) 88%, transparent) 0%,' +
' color-mix(in srgb, var(--tpl-inverse, #1c1917) 45%, transparent) 34%, transparent 66%)',
'linear-gradient(to top, color-mix(in srgb, var(--tpl-inverse, #1c1917) 88%, transparent) 0%, color-mix(in srgb, var(--tpl-inverse, #1c1917) 45%, transparent) 34%, transparent 66%)',
}}
/>
</div>
)}
<div className="shell relative z-10 pb-10 pt-24 sm:pb-12">
{region && (
{locality && (
<p className="mb-3 inline-flex items-center gap-1 text-[length:var(--fs-xs)] opacity-80">
<MapPin className="size-3.5" aria-hidden="true" />
<span>{region}</span>
<MapPin className="size-3.5" />
<span>{locality}</span>
</p>
)}
@@ -72,19 +93,13 @@ export function HeroSection() {
lineHeight: 1.15,
}}
>
{narrative.heroHeadline ? (
<>
<span className="block">{narrative.heroHeadline}</span>
<span className="mt-1 block">{place.name}</span>
</>
) : (
place.name
)}
{place.name}
</h1>
{subline && (
{/* ★ 한 줄이 없으면 요약이라도 세운다 — 이름만 덩그러니 있는 첫 화면은 안내가 아니다. */}
{(narrative.tagline ?? narrative.heroSubline ?? narrative.summary) && (
<p className="measure mt-3 text-[length:var(--fs-lead)] leading-relaxed opacity-85">
{subline}
{narrative.tagline ?? narrative.heroSubline ?? narrative.summary}
</p>
)}
@@ -94,11 +109,12 @@ export function HeroSection() {
className="mt-6 inline-flex items-center gap-1 text-[length:var(--fs-sm)] font-medium underline-offset-4 opacity-80 transition-opacity hover:opacity-100"
>
<span>{spec.label} 보기</span>
<ChevronDown className="size-4" aria-hidden="true" />
<ChevronDown className="size-4" />
</a>
)}
</div>
</div>
</section>
);
}