Clean up code found in the audit
- Replace every em-dash in src and server/src with a colon, comma or hyphen - Give every relative import its file extension (.jsx imports of .tsx fixed) - Delete old-historyMock.ts, unused exports, unused CSS utilities, the unused @ alias and the fallback option nothing passed - One copy each of initials, capitalize, byName and the server's marks() - Move the organization, chapter and event hooks from src/data to src/lib - Schema sync always throws on a mismatch (strict was never turned off) - Replace the placeholder README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4066e9ec61
commit
5274e09571
75 changed files with 282 additions and 688 deletions
|
|
@ -180,7 +180,7 @@ CREATE TABLE event_scopes (
|
|||
-- an every-other-week series is "on", which day
|
||||
-- of the month a monthly one keeps, and the
|
||||
-- weekday used when none is ticked
|
||||
-- ends_on when set, the last day it can meet — which
|
||||
-- ends_on when set, the last day it can meet, which
|
||||
-- also keeps effective_status right
|
||||
-- series_count when set, stops it after that many meetings,
|
||||
-- whichever comes first
|
||||
|
|
@ -297,7 +297,7 @@ CREATE UNIQUE INDEX event_hosts_person_uniq
|
|||
--
|
||||
-- Public by design. Everything in this table can appear on a card,
|
||||
-- and is_published = 0 is the only thing between a row and the open
|
||||
-- web — hence the default of 0, unlike organizations. Anything that
|
||||
-- web, hence the default of 0, unlike organizations. Anything that
|
||||
-- must never be served lives in person_private, so a careless
|
||||
-- SELECT * can't leak it. Bios and pages go in content_blocks,
|
||||
-- socials in links. People sort by sort_name; there is no
|
||||
|
|
@ -306,7 +306,7 @@ CREATE UNIQUE INDEX event_hosts_person_uniq
|
|||
CREATE TABLE people (
|
||||
id TEXT PRIMARY KEY, -- slug: 'jane-doe'
|
||||
display_name TEXT NOT NULL, -- 'Jane Doe'
|
||||
sort_name TEXT, -- 'Doe, Jane' — list ordering
|
||||
sort_name TEXT, -- 'Doe, Jane', list ordering
|
||||
pronouns TEXT, -- 'she/her'
|
||||
tagline TEXT, -- fallback when no title applies
|
||||
photo TEXT, -- filename in public/people/
|
||||
|
|
@ -346,7 +346,7 @@ CREATE TABLE person_private (
|
|||
-- A team belongs to exactly one organization: NGU national has a
|
||||
-- Board and a Leadership Team, a region or chapter can have its own.
|
||||
-- UNIQUE (id, org_id) looks redundant against the primary key, and
|
||||
-- is — except that it gives affiliations a composite foreign key to
|
||||
-- is, except that it gives affiliations a composite foreign key to
|
||||
-- point at, which stops someone filing a person under a team
|
||||
-- belonging to a different organization.
|
||||
CREATE TABLE teams (
|
||||
|
|
@ -548,7 +548,7 @@ CREATE TABLE timeline_entries (
|
|||
|
||||
-- Null inherits from the referenced row: an event's starts_on. A
|
||||
-- hand-authored entry has to supply its own, which the descriptor
|
||||
-- can't require conditionally — the read layer reports an entry
|
||||
-- can't require conditionally, the read layer reports an entry
|
||||
-- with neither rather than the table refusing it.
|
||||
occurred_on TEXT,
|
||||
|
||||
|
|
@ -604,9 +604,9 @@ CREATE INDEX timeline_entry_people_person_idx
|
|||
-- FRONT PAGE
|
||||
-- ═══════════════════════════════════════════════════════════════
|
||||
--
|
||||
-- The home page's editable half. One row in front_page — the CHECK
|
||||
-- The home page's editable half. One row in front_page, the CHECK
|
||||
-- on id makes a second one impossible, and the admin engine treats
|
||||
-- it as a singleton — and ordered collections hanging off it, each
|
||||
-- it as a singleton, and ordered collections hanging off it, each
|
||||
-- replaced wholesale on save. Nothing has a foreign key into them,
|
||||
-- which is what makes that safe.
|
||||
--
|
||||
|
|
@ -759,7 +759,7 @@ CREATE TABLE admin_users (
|
|||
-- password at all. A row with both can use either route in.
|
||||
password_hash TEXT,
|
||||
|
||||
-- Google's stable subject id. Nullable, unique when present —
|
||||
-- Google's stable subject id. Nullable, unique when present,
|
||||
-- SQLite allows any number of NULLs in a unique index.
|
||||
google_sub TEXT UNIQUE,
|
||||
|
||||
|
|
@ -935,7 +935,7 @@ SELECT
|
|||
tm.name AS team_name,
|
||||
|
||||
-- Whether the referenced record is itself visible. An entry must not
|
||||
-- outlive the thing it points at being unpublished — a draft event
|
||||
-- outlive the thing it points at being unpublished, a draft event
|
||||
-- would otherwise leak its title and date onto a public page. Null
|
||||
-- for a standalone milestone, which answers to nothing but its own
|
||||
-- is_published.
|
||||
|
|
@ -964,7 +964,7 @@ LEFT JOIN person_awards pa ON t.ref_kind = 'award' AND pa.award_id = t.re
|
|||
-- ═══════════════════════════════════════════════════════════════
|
||||
--
|
||||
-- What a new database needs before anyone signs in: the scopes an
|
||||
-- event can be filed under, and the front page as it ships — every
|
||||
-- event can be filed under, and the front page as it ships, every
|
||||
-- section, the stats that need no typing, and the Church Center
|
||||
-- forms sorted into paths. Everything else comes in through the
|
||||
-- admin.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue