-- Seed data for the Status Page schema, from section 14 of the blueprint. Load after status-page.sql. -- Dates in the spec are relative to the seed day, Thursday 15 Oct 2026. Times are CDT (UTC-5), stored in UTC. -- Where the spec gives a day but no time, the seed uses 00:00 CDT (05:00 UTC) on that day. INSERT INTO settings (id, page_name, company_name, logo, time_zone, support_url, from_email, email_domain, page_url) VALUES (1, 'Larkspur status', 'Larkspur', NULL, 'America/Chicago', 'https://larkspur.example/support', 'status@larkspur.example', 'larkspur.example', NULL); INSERT INTO team_members (id, name, email, role, active) VALUES ('tm-nadia', 'Nadia Brooks', 'nadia@larkspur.example', 'admin', TRUE), ('tm-owen', 'Owen Price', 'owen@larkspur.example', 'responder', TRUE), ('tm-ivy', 'Ivy Chen', 'ivy@larkspur.example', 'responder', TRUE); INSERT INTO component_groups (id, name, position) VALUES ('grp-app', 'App', 1), ('grp-delivery', 'Delivery', 2); INSERT INTO templates (id, name, title, message) VALUES ('tpl-api', 'Elevated API errors', 'Elevated API error rates', 'We''re investigating increased error rates on API requests and will post an update within 30 minutes.'), ('tpl-email', 'Email delays', 'Delayed invoice emails', 'Invoice emails are being sent with a delay. They are queued, not lost, and we''ll post an update within 30 minutes.'), ('tpl-payments', 'Payments unavailable', 'Payments unavailable', 'Card payments can''t be processed right now. We''re investigating with our payment processor and will post an update within 30 minutes.'); -- "Created more than 90 days ago": the spec gives no date, so the seed uses 1 Jul 2026. Any earlier date gives the same uptime. INSERT INTO components (id, name, description, group_id, position, status, created_at, hidden, automation_token, auto_publish, template_id) VALUES ('cmp-dashboard', 'Dashboard', NULL, 'grp-app', 1, 'operational', '2026-07-01 05:00:00', FALSE, NULL, FALSE, NULL), ('cmp-api', 'API', NULL, 'grp-app', 2, 'operational', '2026-07-01 05:00:00', FALSE, NULL, FALSE, 'tpl-api'), ('cmp-webhooks', 'Webhooks', NULL, 'grp-app', 3, 'operational', '2026-07-01 05:00:00', FALSE, NULL, FALSE, NULL), ('cmp-email', 'Email delivery', NULL, 'grp-delivery', 1, 'operational', '2026-07-01 05:00:00', FALSE, NULL, FALSE, 'tpl-email'), ('cmp-payments', 'Payments', 'Processed by Stripe', 'grp-delivery', 2, 'operational', '2026-07-01 05:00:00', FALSE, NULL, FALSE, 'tpl-payments'); INSERT INTO template_components (template_id, component_id, status) VALUES ('tpl-api', 'cmp-api', 'partial_outage'), ('tpl-email', 'cmp-email', 'degraded_performance'), ('tpl-payments', 'cmp-payments', 'major_outage'); INSERT INTO incidents (id, number, title, status, impact, started_at, resolved_at, postmortem, postmortem_at, created_by, related_to) VALUES ('inc-0013', 13, 'API errors for some requests', 'resolved', 'major', '2026-09-18 14:00:00', '2026-09-18 14:42:00', NULL, NULL, 'tm-ivy', NULL), ('inc-0014', 14, 'Invoice emails delayed', 'resolved', 'minor', '2026-10-02 18:10:00', '2026-10-02 21:10:00', NULL, NULL, 'tm-owen', NULL); -- The spec gives no message for the 16:10 Resolved update of INC-0014; the seed uses the resolved text of INC-0013. -- The spec does not say whether these updates had notify on; the seed sets TRUE. INSERT INTO incident_updates (id, incident_id, status, message, notify, published_at, author_id) VALUES ('upd-13-1', 'inc-0013', 'investigating', 'We''re seeing errors on a share of API requests and are investigating.', TRUE, '2026-09-18 14:00:00', 'tm-ivy'), ('upd-13-2', 'inc-0013', 'identified', 'A database connection limit was reached after a configuration change. We''re rolling it back.', TRUE, '2026-09-18 14:18:00', 'tm-ivy'), ('upd-13-3', 'inc-0013', 'monitoring', 'The change is rolled back and error rates are back to normal. We''re monitoring.', TRUE, '2026-09-18 14:30:00', 'tm-ivy'), ('upd-13-4', 'inc-0013', 'resolved', 'This incident has been resolved.', TRUE, '2026-09-18 14:42:00', 'tm-ivy'), ('upd-14-1', 'inc-0014', 'investigating', 'Invoice emails are being sent with a delay. We''re investigating.', TRUE, '2026-10-02 18:10:00', 'tm-owen'), ('upd-14-2', 'inc-0014', 'identified', 'Our email provider is working through a backlog; invoice emails are queued, not lost.', TRUE, '2026-10-02 18:40:00', 'tm-owen'), ('upd-14-3', 'inc-0014', 'monitoring', 'The backlog has cleared and new invoice emails are going out normally. We''re monitoring.', TRUE, '2026-10-02 20:20:00', 'tm-owen'), ('upd-14-4', 'inc-0014', 'resolved', 'This incident has been resolved.', TRUE, '2026-10-02 21:10:00', 'tm-owen'); -- The first update of each incident set the outage; the updates in between set no new status, and resolving returned the component to operational (R6). INSERT INTO incident_update_components (update_id, component_id, status) VALUES ('upd-13-1', 'cmp-api', 'major_outage'), ('upd-14-1', 'cmp-email', 'partial_outage'); INSERT INTO maintenance_windows (id, number, title, message, starts_at, ends_at, status, notify) VALUES ('mnt-0003', 3, 'Database upgrade', 'We''re upgrading our main database. The dashboard and API may be briefly unavailable during this window.', '2026-10-18 07:00:00', '2026-10-18 08:00:00', 'scheduled', TRUE); INSERT INTO maintenance_components (maintenance_id, component_id) VALUES ('mnt-0003', 'cmp-dashboard'), ('mnt-0003', 'cmp-api'); -- Components were added by an admin; Nadia Brooks is the only admin in the seed. INSERT INTO status_changes (id, component_id, status, at, incident_id, maintenance_id, actor) VALUES ('sc-1', 'cmp-dashboard', 'operational', '2026-07-01 05:00:00', NULL, NULL, 'tm-nadia'), ('sc-2', 'cmp-api', 'operational', '2026-07-01 05:00:00', NULL, NULL, 'tm-nadia'), ('sc-3', 'cmp-webhooks', 'operational', '2026-07-01 05:00:00', NULL, NULL, 'tm-nadia'), ('sc-4', 'cmp-email', 'operational', '2026-07-01 05:00:00', NULL, NULL, 'tm-nadia'), ('sc-5', 'cmp-payments', 'operational', '2026-07-01 05:00:00', NULL, NULL, 'tm-nadia'), ('sc-6', 'cmp-api', 'major_outage', '2026-09-18 14:00:00', 'inc-0013', NULL, 'tm-ivy'), ('sc-7', 'cmp-api', 'operational', '2026-09-18 14:42:00', 'inc-0013', NULL, 'tm-ivy'), ('sc-8', 'cmp-email', 'partial_outage', '2026-10-02 18:10:00', 'inc-0014', NULL, 'tm-owen'), ('sc-9', 'cmp-email', 'operational', '2026-10-02 21:10:00', 'inc-0014', NULL, 'tm-owen'); INSERT INTO subscribers (id, email, all_components, confirm_token, confirm_sent_at, confirmed_at, manage_token, unsubscribed_at, created_ip) VALUES ('sub-sam', 'sam@clientco.example', TRUE, NULL, NULL, '2026-09-15 05:00:00', NULL, NULL, NULL), ('sub-lee', 'lee@agency.example', FALSE, NULL, NULL, '2026-09-15 05:00:00', NULL, NULL, NULL), ('sub-ana', 'ana@studio.example', TRUE, NULL, NULL, '2026-09-15 05:00:00', NULL, NULL, NULL), ('sub-jo', 'jo@freelance.example', FALSE, NULL, NULL, '2026-09-15 05:00:00', NULL, NULL, NULL), ('sub-max', 'max@pending.example', TRUE, NULL, '2026-10-13 05:00:00', NULL, NULL, NULL, NULL); INSERT INTO subscriber_components (subscriber_id, component_id) VALUES ('sub-lee', 'cmp-api'), ('sub-lee', 'cmp-webhooks'), ('sub-jo', 'cmp-email');