← back to Stayclaim
db/seed-entities.sql
31 lines
-- Seed one historical person + one architect so the Person page has data.
-- All dates are placeholders for UI testing; not historical fact.
INSERT INTO entity (slug, kind, display_name, birth_year, death_year, is_living, bio_short, wiki_url)
VALUES
('paul-r-williams', 'architect', 'Paul R. Williams', 1894, 1980, false,
'Los Angeles architect of over 2,000 homes — Beverly Hills, Hancock Park, LA estates.',
'https://en.wikipedia.org/wiki/Paul_Revere_Williams'),
('joan-didion', 'person', 'Joan Didion', 1934, 2021, false,
'American writer associated with multiple Los Angeles addresses over her career.',
'https://en.wikipedia.org/wiki/Joan_Didion')
ON CONFLICT (slug) DO NOTHING;
-- Associate each with a seed listing. All historical (deceased), all tier B/C.
-- Mark public_visible=true so the UI renders them (privacy trigger allows it).
WITH
pw AS (SELECT id FROM entity WHERE slug = 'paul-r-williams'),
jd AS (SELECT id FROM entity WHERE slug = 'joan-didion'),
malibu AS (SELECT id FROM listing WHERE slug = 'malibu-ocean-bungalow'),
echo AS (SELECT id FROM listing WHERE slug = 'echo-park-craftsman')
INSERT INTO entity_place_association (entity_id, listing_id, relation, date_from, date_to, summary, source_tier, source_urls, confidence, review_status, public_visible)
SELECT pw.id, malibu.id, 'designer', DATE '1948-01-01', DATE '1949-12-31',
'Commissioned design for the original bungalow (placeholder association for UI testing).',
'C', ARRAY['https://example.com/citation'], 0.6, 'approved', true
FROM pw, malibu
UNION ALL
SELECT jd.id, echo.id, 'resident', DATE '1966-01-01', DATE '1973-12-31',
'Lived in the neighborhood during early-career years (placeholder association for UI testing).',
'C', ARRAY['https://example.com/citation'], 0.5, 'approved', true
FROM jd, echo
ON CONFLICT DO NOTHING;