---
title: Retire draft_type and conform draft-window naming
type: task
status: planned
description: >-
  Drop the inert seasons.draft_type column with its five consumer sites, and conform the three
  camelCase draft-window exports to snake_case. Both deferred out of the daily-slate change to keep
  a mid-draft deploy surgical.
base_uri: user:task/league/retire-draft-type-and-conform-draft-window-naming.md
created_at: '2026-08-16T18:43:20.526Z'
entity_id: 62022c10-652c-45d7-9d77-651a229c1bc4
observations:
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: Low
public_read: true
relations:
  - succeeds [[█████████████████████████-█████-███████-██-█████████-█████-████████]]
tags:
  - user:tag/league-xo-football.md
updated_at: '2026-08-16T18:43:26.361Z'
visibility_analyzed_at: '2026-11-06T00:18:02.838Z'
---

# Retire draft_type and conform draft-window naming

## Overview

Two behavior-neutral cleanups deferred out of
`███████████████████████████████████████████████████████████████████`, to land after the 2026 rookie
draft completes. Both were in that plan's first draft and were split out because neither traces to
either operator goal, and a deploy onto a live board should carry only changes that do.

- **Drop `seasons.draft_type`.** The slate calculator stops reading it in the predecessor task, so
  the column is inert on arrival here. Dropping it is the removal of dead config, but it breaks five
  sites, two of them silently.
- **Conform the three camelCase exports** the draft-window calculator still carries, matching the
  direction the repo is already moving (`get_draft_window_config`, `is_within_daily_window` are the
  recent additions).

## Assumptions

- **`draft_type` is unread by the window calculator once the predecessor task ships.** Check:
  `grep -rn "cadence_unit\|draft_type" libs-shared/` returns nothing in the window path.
- **The four `'day'` rows carry `draft_pick_interval = 24` on a `[0, 24)` band** by then, so their
  windows are already correct without the column. Check: `select draft_type, draft_pick_interval, draft_hour_min, draft_hour_max from seasons where draft_type is not null`.
- **No Postgres view depends on `seasons`.** A view defined `SELECT t.*` snapshots its column list
  and refuses `DROP COLUMN` outright. Check: `select viewname from pg_views where definition ilike '%seasons%'`.
- **`draft_type` on `pff_player_seasonlogs` and in the ESPN/Sleeper adapters is a DIFFERENT concept**
  — the grades supplier's draft metadata and `'SNAKE'`/`'LINEAR'` respectively. Neither is in scope. Check: read
  `db/schema.postgres.sql` around the `pff_player_seasonlogs` block and
  `libs-server/external-fantasy-leagues/adapters/espn.mjs`.

## Plan

### Drop the column

- [ ] Sweep the five consumers before touching the schema: `libs-server/create-league.mjs:94` and
      `scripts/generate-seasons.mjs:42` write it in insert payloads;
      `app/core/leagues/league.js:78,196,305` declares it in the Record, in `createLeague` and in the
      constructor call; `app/core/selectors.js:421` and `:582` gate the `draftWindow` assignment on
      `if (league.draft_start && league.draft_type)`. — verify: the two SPA predicates are the
      dangerous half — dropping the column makes them permanently false and every window label
      vanishes with no error, so drive the draft page in a browser after the sweep and before the
      drop.
- [ ] Confirm the ESPN and Sleeper adapters and `pff_player_seasonlogs` are untouched by the sweep. —
      verify: `git diff --stat` names no file under `external-fantasy-leagues/` or `private/`.
- [ ] Author `db/adhoc/<date>-drop-seasons-draft-type.sql` and apply it, exporting the schema and
      committing the DDL, the export and the consumer sweep as ONE commit. — verify: dry-run through
      `yarn db:exec` from a `tmp/` copy with a trailing `RAISE EXCEPTION`.
- [ ] Update `user:text/league/data-model-reference.md` and any repo `docs/` naming the column. —
      verify: `node db/gates/check-league-schema-consumers.mjs --gate 1` with the user-base roots
      passed explicitly.

### Conform the naming

- [ ] Rename `getDraftWindow` to `get_draft_window`, `getDraftDates` to `get_draft_dates`,
      `isDraftWindowOpen` to `is_draft_window_open`, and the `draftEnd` / `waiverEnd` return keys to
      `draft_end` / `waiver_end`, across every call site, in its own commit. — verify: `grep -rn` for
      each old name returns nothing outside historical prose; full suite green.
- [ ] Decide whether `seasons.draft_start` should become `rookie_draft_start_at`, now that its
      sibling is `rookie_draft_end_at`. — verify: state the decision in the commit message either
      way; leaving the pair asymmetric needs a reason, not silence.

## Notes

Sequencing: strictly after the 2026 rookie draft completes (`seasons.rookie_draft_completed_at` is
set for lid 1 / 2026). Nothing here is urgent and nothing here is user-visible when done correctly,
which is exactly why it must not ride a mid-draft deploy.
