analytics/infrastructure/seed-cross-domain.sql
autocommit 16da6276d2 feat(api): Add migration and seed script for visitor_identity and corp_domain tables
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-14 22:58:03 -07:00

28 lines
2 KiB
SQL

-- Cross-domain, cross-corp visitor flow — manual bootstrap.
-- Mirrors services/api/migrations/1747200000000-AddVisitorIdentityAndCorpDomain.ts
-- for environments where no TypeORM migration runner is configured.
--
-- Apply against the analytics Postgres DB after the collector boots once
-- (so TypeORM synchronize creates corps/domains/visitor_salts table shells
-- from the entity definitions). This script only inserts the seed rows.
INSERT INTO corps (slug, legal_name) VALUES
('lilith-apps-ehf', 'Lilith Apps ehf'),
('att', 'Adult Therapy Tour'),
('sansonnet', 'Maison Sansonnet'),
('transquinnftw', 'transquinnftw')
ON CONFLICT (slug) DO NOTHING;
INSERT INTO domains (corp_id, hostname, role) VALUES
((SELECT id FROM corps WHERE slug='att'), 'adulttherapytour.com', 'canonical'),
((SELECT id FROM corps WHERE slug='att'), 'adulttherapy.tours', 'alias'),
((SELECT id FROM corps WHERE slug='att'), 'apa.singles', 'seo_bait'),
((SELECT id FROM corps WHERE slug='att'), 'fuckatapa.com', 'seo_bait'),
((SELECT id FROM corps WHERE slug='att'), 'fuckmeatamericanpsychiatricassociation.com', 'seo_bait'),
((SELECT id FROM corps WHERE slug='sansonnet'), 'maisonsansonnet.com', 'canonical'),
((SELECT id FROM corps WHERE slug='sansonnet'), 'sansonnet.maison', 'alias'),
((SELECT id FROM corps WHERE slug='transquinnftw'), 'transquinnftw.com', 'canonical'),
((SELECT id FROM corps WHERE slug='transquinnftw'), 'tqftw.com', 'alias'),
((SELECT id FROM corps WHERE slug='lilith-apps-ehf'), 'atlilith.com', 'canonical'),
((SELECT id FROM corps WHERE slug='lilith-apps-ehf'), 'trustedmeet.com', 'canonical')
ON CONFLICT (hostname) DO NOTHING;