NGU-Web/server/src/migrations
Zaldimmar 25e592bfea Clean up the schema: drop unused tables, rename scopes, publishable awards
Migrations 020–023, with the code that reads each:

- 020 drops people_lists, people_list_members, v_chapters and
  v_person_affiliations. Nothing queried any of them.
- 021 renames event_sections to event_scopes and events.section_id
  to scope_id, finishing what 015 described. The API sends `scopes`
  and `scope_id`, and useEvents, EventListCards and EventCalendar
  take `scope`. It also inserts national/regional/partner, which only
  the retired seed ever created: a database built from migrations
  alone had no scope for the Retreats bands.
- 022 drops events.sort_order and people.sort_order. Events now sort
  by date (upcoming soonest first, past latest first, undated last)
  on /events, org pages and the countdown. People were only ever
  sorted by sort_name on the site. Every other sort_order stays.
- 023 rebuilds teams with created_at and updated_at plus a touch
  trigger, so the teams editor gets the same optimistic concurrency
  as the other entities.

Awards can be drafted: is_published (added in 011) is on both
descriptor halves with a Publishing group, and the award list, award
page, org awards and event awards leave drafts out.

The migration runner now turns foreign keys off around the per-file
transactions and runs foreign_key_check before each commit. PRAGMA
foreign_keys is a no-op inside a transaction, so 009's warning was
right and a rebuild of a referenced table (023) couldn't be written
otherwise. CLAUDE.md is updated to match.

Also removes the stray src/App.tsx.save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 17:09:58 -05:00
..
001_init.sql v1.3 - added an sqlite db and built data structure 2026-09-25 02:35:46 -05:00
002_schema.sql v1.3 - added an sqlite db and built data structure 2026-09-25 02:35:46 -05:00
003_auth.sql v1.4 - added admin page and auth 2026-09-25 02:36:49 -05:00
004_award_org.sql v1.4 - added admin page and auth 2026-09-25 02:36:49 -05:00
005_person_bio.sql v1.4 - added admin page and auth 2026-09-25 02:36:49 -05:00
006_leadership_view.sql v1.4 - added admin page and auth 2026-09-25 02:36:49 -05:00
007_timeline.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
008_timeline_view.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
009_superadmin.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
010_editor_role.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
011_award_published.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
012_event_hosts.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
013_drop_host_org_id.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
014_event-type.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
015_event-scopes.sql v1.5 - history and timeline as well as many datastructure updates added, polished, fixes 2026-09-25 02:38:51 -05:00
016_event-series.sql Add recurring series to events 2026-09-25 04:46:49 -05:00
017_front_page.sql Replace the front page with an admin-driven home 2026-09-25 05:37:42 -05:00
018_front_page_touch.sql Replace the front page with an admin-driven home 2026-09-25 05:37:42 -05:00
019_front_page_calendar.sql Add a reusable event calendar and put it on the front page 2026-09-25 06:28:42 -05:00
020_drop_unused.sql Clean up the schema: drop unused tables, rename scopes, publishable awards 2026-09-26 17:09:58 -05:00
021_event_scopes.sql Clean up the schema: drop unused tables, rename scopes, publishable awards 2026-09-26 17:09:58 -05:00
022_drop_sort_orders.sql Clean up the schema: drop unused tables, rename scopes, publishable awards 2026-09-26 17:09:58 -05:00
023_teams_updated_at.sql Clean up the schema: drop unused tables, rename scopes, publishable awards 2026-09-26 17:09:58 -05:00