-- Seed data for the Internal Knowledge Base schema, from section 15 of the blueprint. Load after knowledge-base.sql. -- Pinecrest Software. The clock in the spec is Wed 14 Oct 2026, 09:00 America/New_York (13:00 UTC). -- Seed actions happen at 10:00 New York time unless a time is given: 14:00 UTC from 8 Mar 2026, 15:00 UTC before it. INSERT INTO settings (id, company_name, time_zone, last_daily_run_at) VALUES (1, 'Pinecrest Software', 'America/New_York', NULL); INSERT INTO teams (id, name) VALUES ('team-operations', 'Operations'), ('team-engineering', 'Engineering'), ('team-sales', 'Sales'), ('team-support', 'Support'), ('team-design', 'Design'); INSERT INTO people (id, name, email, team_id, is_admin, active, slack_user_id, slack_lookup_error) VALUES ('p-dana', 'Dana Ruiz', 'dana@pinecrest.example', 'team-operations', TRUE, TRUE, 'U0DANA', NULL), ('p-ana', 'Ana Lima', 'ana@pinecrest.example', 'team-operations', FALSE, TRUE, 'U0ANA', NULL), ('p-ben', 'Ben Cho', 'ben@pinecrest.example', 'team-operations', TRUE, TRUE, 'U0BEN', NULL), ('p-sam', 'Sam Okafor', 'sam@pinecrest.example', 'team-engineering', FALSE, TRUE, 'U0SAM', NULL), ('p-jo', 'Jo Park', 'jo@pinecrest.example', 'team-engineering', FALSE, TRUE, 'U0JO', NULL), ('p-rosa', 'Rosa Quinn', 'rosa@pinecrest.example', 'team-sales', FALSE, TRUE, 'U0ROSA', NULL), ('p-lee', 'Lee Park', 'lee@pinecrest.example', 'team-sales', FALSE, TRUE, 'U0LEE', NULL), ('p-priya', 'Priya Nair', 'priya@pinecrest.example', 'team-support', FALSE, TRUE, 'U0PRIYA', NULL), ('p-tom', 'Tom Bennett', 'tom@pinecrest.example', 'team-support', FALSE, TRUE, 'U0TOM', NULL), ('p-maya', 'Maya Chen', 'maya@pinecrest.example', 'team-design', FALSE, TRUE, NULL, NULL), ('p-kai', 'Kai Brooks', 'kai@pinecrest.example', 'team-operations', FALSE, FALSE, NULL, NULL); INSERT INTO collections (id, name, description, visibility) VALUES ('col-it', 'IT & Accounts', NULL, 'everyone'), ('col-people', 'People & Policies', NULL, 'everyone'), ('col-sales', 'Sales playbook', NULL, 'teams'), ('col-finance', 'Finance', NULL, 'teams'); INSERT INTO collection_teams (collection_id, team_id) VALUES ('col-sales', 'team-sales'), ('col-finance', 'team-operations'); INSERT INTO collection_editors (collection_id, person_id) VALUES ('col-it', 'p-ben'), ('col-it', 'p-sam'), ('col-it', 'p-kai'), ('col-people', 'p-ana'), ('col-people', 'p-dana'), ('col-sales', 'p-rosa'), ('col-sales', 'p-lee'), ('col-finance', 'p-ana'); INSERT INTO cards (id, number, collection_id, status, title, body, owner_id, review_interval_days, verified_at, verified_by, verified_until, needs_verification, needs_verification_by, needs_verification_at, version, created_by, created_at, updated_by, updated_at, archived_by, archived_at, reminder_sent_for, overdue_sent_for) VALUES ('card-101', 101, 'col-it', 'published', 'How do I connect to the VPN?', 'Install Tailscale from tailscale.com/download. Sign in with your company Google account. If your laptop isn''t listed, message Ben Cho.', 'p-ben', 90, '2026-10-13 14:00:00', 'p-ben', '2027-01-11', NULL, NULL, NULL, 2, 'p-ben', '2026-07-06 14:00:00', 'p-ben', '2026-10-13 14:00:00', NULL, NULL, NULL, NULL), ('card-102', 102, 'col-it', 'published', 'How do I reset my laptop password?', 'Restart the laptop and click Forgot password on the sign-in screen. If that fails, message Ben Cho.', 'p-ben', 180, '2026-07-20 14:00:00', 'p-ben', '2027-01-16', NULL, NULL, NULL, 1, 'p-ben', '2026-07-20 14:00:00', 'p-ben', '2026-07-20 14:00:00', NULL, NULL, NULL, NULL), ('card-103', 103, 'col-it', 'published', 'What is the office Wi-Fi password?', 'The network is Pinecrest-Guest. The password is on the board by reception and changes on the first Monday of each month.', 'p-ben', 30, '2026-09-04 14:00:00', 'p-ben', '2026-10-04', NULL, NULL, NULL, 1, 'p-ben', '2026-09-04 14:00:00', 'p-ben', '2026-09-04 14:00:00', NULL, NULL, NULL, NULL), ('card-104', 104, 'col-it', 'published', 'Who approves software purchases?', 'Under $500 a year: your team lead approves. $500 a year or more: send the quote to Ana Lima in Finance.', 'p-ben', 90, '2026-08-03 14:00:00', 'p-ben', '2026-11-01', 'edited', 'p-sam', '2026-10-13 15:30:00', 2, 'p-ben', '2026-08-03 14:00:00', 'p-sam', '2026-10-13 15:30:00', NULL, NULL, NULL, NULL), ('card-105', 105, 'col-people', 'published', 'How do I submit an expense?', 'Upload the receipt in Brex within 30 days. Meals are reimbursed up to $50 per person.', 'p-ana', 90, '2026-09-14 14:00:00', 'p-ana', '2026-12-13', NULL, NULL, NULL, 1, 'p-ana', '2026-09-14 14:00:00', 'p-ana', '2026-09-14 14:00:00', NULL, NULL, NULL, NULL), ('card-106', 106, 'col-people', 'published', 'How many vacation days do I get?', 'Everyone gets 20 vacation days a year, plus public holidays. Book them in the Time-Off Tracker.', 'p-ana', 365, '2026-01-08 15:00:00', 'p-ana', '2027-01-08', NULL, NULL, NULL, 1, 'p-ana', '2026-01-08 15:00:00', 'p-ana', '2026-01-08 15:00:00', NULL, NULL, NULL, NULL), ('card-107', 107, 'col-sales', 'published', 'What discount can we offer on annual plans?', 'Up to 15% off an annual plan. Anything above 15% needs Rosa Quinn''s approval.', 'p-rosa', 90, '2026-07-27 14:00:00', 'p-rosa', '2026-10-25', NULL, NULL, NULL, 1, 'p-rosa', '2026-07-27 14:00:00', 'p-rosa', '2026-07-27 14:00:00', NULL, NULL, NULL, NULL), ('card-108', 108, 'col-finance', 'published', 'What is each team''s card spending limit?', 'Each team lead''s card has a $2,000 monthly limit. Ana Lima can raise it for one month.', 'p-ana', 180, '2026-10-05 14:00:00', 'p-ana', '2027-04-03', NULL, NULL, NULL, 1, 'p-ana', '2026-10-05 14:00:00', 'p-ana', '2026-10-05 14:00:00', NULL, NULL, NULL, NULL), ('card-109', 109, 'col-people', 'published', 'How do I book a meeting room?', 'Use the Rooms calendar in Google Calendar. Rooms are first come, first served.', 'p-dana', NULL, '2026-03-02 15:00:00', 'p-dana', NULL, NULL, NULL, NULL, 1, 'p-dana', '2026-03-02 15:00:00', 'p-dana', '2026-03-02 15:00:00', NULL, NULL, NULL, NULL), ('card-110', 110, 'col-people', 'draft', 'How do I get a parking pass?', 'Ask Dana Ruiz for a pass. Passes last until the end of the year.', 'p-ana', 90, NULL, NULL, NULL, NULL, NULL, NULL, 0, 'p-ana', '2026-10-13 14:00:00', 'p-ana', '2026-10-13 14:00:00', NULL, NULL, NULL, NULL), ('card-111', 111, 'col-it', 'archived', 'Where is the old shared drive?', 'The old shared drive moved to Google Drive in June.', 'p-ben', 90, '2026-02-02 15:00:00', 'p-ben', '2026-05-03', NULL, NULL, NULL, 1, 'p-ben', '2026-02-02 15:00:00', 'p-ben', '2026-02-02 15:00:00', 'p-ben', '2026-10-05 14:00:00', NULL, NULL), ('card-112', 112, 'col-it', 'published', 'How do I set up two-factor sign-in?', 'Install Google Authenticator on your phone. Scan the code on your laptop''s account page.', 'p-kai', 180, '2026-04-06 14:00:00', 'p-kai', '2026-10-03', NULL, NULL, NULL, 1, 'p-kai', '2026-04-06 14:00:00', 'p-kai', '2026-04-06 14:00:00', NULL, NULL, NULL, NULL); INSERT INTO card_questions (card_id, position, question) VALUES ('card-101', 1, 'VPN not working'), ('card-101', 2, 'Tailscale setup'), ('card-102', 1, 'Locked out of my laptop'), ('card-104', 1, 'Can I buy a software subscription?'), ('card-105', 1, 'How do I get reimbursed?'), ('card-106', 1, 'How much PTO do I have?'), ('card-112', 1, 'Two-factor setup'); INSERT INTO card_tags (card_id, position, tag) VALUES ('card-101', 1, 'vpn'), ('card-101', 2, 'remote'), ('card-102', 1, 'laptop'), ('card-102', 2, 'password'), ('card-103', 1, 'wifi'), ('card-103', 2, 'office'), ('card-104', 1, 'software'), ('card-104', 2, 'purchasing'), ('card-105', 1, 'expenses'), ('card-105', 2, 'reimbursement'), ('card-106', 1, 'vacation'), ('card-106', 2, 'pto'), ('card-106', 3, 'leave'), ('card-107', 1, 'discount'), ('card-107', 2, 'pricing'), ('card-108', 1, 'card'), ('card-108', 2, 'budget'), ('card-109', 1, 'rooms'), ('card-109', 2, 'office'), ('card-110', 1, 'parking'), ('card-110', 2, 'office'), ('card-111', 1, 'drive'), ('card-112', 1, 'security'), ('card-112', 2, '2fa'); -- Earlier versions keep the current title, questions and tags and differ only in the body (section 15). INSERT INTO card_versions (id, card_id, number, title, body, questions, tags, change_note, author_id, published_at) VALUES ('ver-101-1', 'card-101', 1, 'How do I connect to the VPN?', 'Install Cisco AnyConnect from the Self Service app. Sign in with your company email and password.', 'VPN not working Tailscale setup', 'vpn remote', '', 'p-ben', '2026-07-06 14:00:00'), ('ver-101-2', 'card-101', 2, 'How do I connect to the VPN?', 'Install Tailscale from tailscale.com/download. Sign in with your company Google account. If your laptop isn''t listed, message Ben Cho.', 'VPN not working Tailscale setup', 'vpn remote', 'Moved from Cisco AnyConnect to Tailscale', 'p-ben', '2026-10-13 14:00:00'), ('ver-102-1', 'card-102', 1, 'How do I reset my laptop password?', 'Restart the laptop and click Forgot password on the sign-in screen. If that fails, message Ben Cho.', 'Locked out of my laptop', 'laptop password', '', 'p-ben', '2026-07-20 14:00:00'), ('ver-103-1', 'card-103', 1, 'What is the office Wi-Fi password?', 'The network is Pinecrest-Guest. The password is on the board by reception and changes on the first Monday of each month.', '', 'wifi office', '', 'p-ben', '2026-09-04 14:00:00'), ('ver-104-1', 'card-104', 1, 'Who approves software purchases?', 'Your team lead approves software purchases. Send receipts to Ana Lima.', 'Can I buy a software subscription?', 'software purchasing', '', 'p-ben', '2026-08-03 14:00:00'), ('ver-104-2', 'card-104', 2, 'Who approves software purchases?', 'Under $500 a year: your team lead approves. $500 a year or more: send the quote to Ana Lima in Finance.', 'Can I buy a software subscription?', 'software purchasing', 'Added the $500 yearly limit', 'p-sam', '2026-10-13 15:30:00'), ('ver-105-1', 'card-105', 1, 'How do I submit an expense?', 'Upload the receipt in Brex within 30 days. Meals are reimbursed up to $50 per person.', 'How do I get reimbursed?', 'expenses reimbursement', '', 'p-ana', '2026-09-14 14:00:00'), ('ver-106-1', 'card-106', 1, 'How many vacation days do I get?', 'Everyone gets 20 vacation days a year, plus public holidays. Book them in the Time-Off Tracker.', 'How much PTO do I have?', 'vacation pto leave', '', 'p-ana', '2026-01-08 15:00:00'), ('ver-107-1', 'card-107', 1, 'What discount can we offer on annual plans?', 'Up to 15% off an annual plan. Anything above 15% needs Rosa Quinn''s approval.', '', 'discount pricing', '', 'p-rosa', '2026-07-27 14:00:00'), ('ver-108-1', 'card-108', 1, 'What is each team''s card spending limit?', 'Each team lead''s card has a $2,000 monthly limit. Ana Lima can raise it for one month.', '', 'card budget', '', 'p-ana', '2026-10-05 14:00:00'), ('ver-109-1', 'card-109', 1, 'How do I book a meeting room?', 'Use the Rooms calendar in Google Calendar. Rooms are first come, first served.', '', 'rooms office', '', 'p-dana', '2026-03-02 15:00:00'), ('ver-111-1', 'card-111', 1, 'Where is the old shared drive?', 'The old shared drive moved to Google Drive in June.', '', 'drive', '', 'p-ben', '2026-02-02 15:00:00'), ('ver-112-1', 'card-112', 1, 'How do I set up two-factor sign-in?', 'Install Google Authenticator on your phone. Scan the code on your laptop''s account page.', 'Two-factor setup', 'security 2fa', '', 'p-kai', '2026-04-06 14:00:00'); INSERT INTO flags (id, card_id, person_id, reason, created_at, status, resolved_at, resolved_by, resolution) VALUES ('flag-1', 'card-101', 'p-priya', 'Cisco AnyConnect stopped working for me.', '2026-10-12 19:00:00', 'resolved', '2026-10-13 14:00:00', 'p-ben', 'verified'), ('flag-2', 'card-105', 'p-jo', 'The meal limit changed to $60 in October.', '2026-10-12 14:00:00', 'open', NULL, NULL, NULL); INSERT INTO follows (card_id, person_id, created_at) VALUES ('card-101', 'p-jo', '2026-07-06 14:00:00'), ('card-101', 'p-lee', '2026-07-06 14:00:00'); -- Publishing or editing with "Verify now" is one event that records the verification (R19). INSERT INTO card_events (id, card_id, actor_id, created_at, type, data) VALUES ('ev-101-1', 'card-101', 'p-ben', '2026-07-06 14:00:00', 'created', '{}'), ('ev-101-2', 'card-101', 'p-ben', '2026-07-06 14:00:00', 'published', '{"version": 1, "verified": false}'), ('ev-101-3', 'card-101', 'p-priya', '2026-10-12 19:00:00', 'flagged', '{}'), ('ev-101-4', 'card-101', 'p-ben', '2026-10-13 14:00:00', 'updated', '{"version": 2, "verified": true, "flags_resolved": 1}'), ('ev-102-1', 'card-102', 'p-ben', '2026-07-20 14:00:00', 'created', '{}'), ('ev-102-2', 'card-102', 'p-ben', '2026-07-20 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-103-1', 'card-103', 'p-ben', '2026-09-04 14:00:00', 'created', '{}'), ('ev-103-2', 'card-103', 'p-ben', '2026-09-04 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-104-1', 'card-104', 'p-ben', '2026-08-03 14:00:00', 'created', '{}'), ('ev-104-2', 'card-104', 'p-ben', '2026-08-03 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-104-3', 'card-104', 'p-sam', '2026-10-13 15:30:00', 'updated', '{"version": 2, "verified": false}'), ('ev-105-1', 'card-105', 'p-ana', '2026-09-14 14:00:00', 'created', '{}'), ('ev-105-2', 'card-105', 'p-ana', '2026-09-14 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-105-3', 'card-105', 'p-jo', '2026-10-12 14:00:00', 'flagged', '{}'), ('ev-106-1', 'card-106', 'p-ana', '2026-01-08 15:00:00', 'created', '{}'), ('ev-106-2', 'card-106', 'p-ana', '2026-01-08 15:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-107-1', 'card-107', 'p-rosa', '2026-07-27 14:00:00', 'created', '{}'), ('ev-107-2', 'card-107', 'p-rosa', '2026-07-27 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-108-1', 'card-108', 'p-ana', '2026-10-05 14:00:00', 'created', '{}'), ('ev-108-2', 'card-108', 'p-ana', '2026-10-05 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-109-1', 'card-109', 'p-dana', '2026-03-02 15:00:00', 'created', '{}'), ('ev-109-2', 'card-109', 'p-dana', '2026-03-02 15:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-110-1', 'card-110', 'p-ana', '2026-10-13 14:00:00', 'created', '{}'), ('ev-111-1', 'card-111', 'p-ben', '2026-02-02 15:00:00', 'created', '{}'), ('ev-111-2', 'card-111', 'p-ben', '2026-02-02 15:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'), ('ev-111-3', 'card-111', 'p-ben', '2026-10-05 14:00:00', 'archived', '{"flags_resolved": 0}'), ('ev-112-1', 'card-112', 'p-kai', '2026-04-06 14:00:00', 'created', '{}'), ('ev-112-2', 'card-112', 'p-kai', '2026-04-06 14:00:00', 'published', '{"version": 1, "verified": true, "flags_resolved": 0}'); INSERT INTO search_logs (id, query, result_count, created_at) VALUES ('search-1', 'parking pass', 0, '2026-10-12 14:00:00'), ('search-2', 'parking pass', 0, '2026-10-13 13:00:00'), ('search-3', 'parking pass', 0, '2026-10-13 18:00:00'), ('search-4', 'payroll date', 0, '2026-10-09 14:00:00'), ('search-5', 'payroll date', 0, '2026-10-13 14:00:00'), ('search-6', 'dental plan', 0, '2026-10-07 14:00:00'), ('search-7', 'dental plan', 0, '2026-09-07 14:00:00');