---
estimated_steps: 17
estimated_files: 3
skills_used: []
---

# T01: Add hidden flag to Creator model and filter TestCreator from API

Add a `hidden` boolean column to the Creator model with default=False. Create an Alembic migration that adds the column and marks the TestCreator record as hidden. Update the `list_creators()` query and total count query to filter out hidden creators.

## Steps

1. Read `backend/models.py` — add `hidden: Mapped[bool]` column to the Creator class with `default=False, server_default='false'`
2. Generate Alembic migration: `cd backend && alembic revision --autogenerate -m 'add_creator_hidden_flag'`
3. Edit the generated migration to include a data migration step: `UPDATE creators SET hidden = true WHERE slug = 'testcreator'` (or whatever the test creator's slug is — check by reading the existing data migration or searching for 'test' in prior migrations)
4. Read `backend/routers/creators.py` — add `.where(Creator.hidden != True)` to the main `list_creators()` query (the `stmt = select(...)` before genre/sort)
5. Also add the same filter to the total count query if one exists in the endpoint
6. Verify: run `cd backend && python -c "from models import Creator; print('hidden' in [c.key for c in Creator.__table__.columns])"` to confirm the column exists in the model

## Must-Haves

- [ ] Creator model has `hidden` boolean column with server_default='false'
- [ ] Alembic migration adds column and marks TestCreator as hidden
- [ ] list_creators() filters out hidden creators
- [ ] Migration file is syntactically valid

## Verification

- `cd backend && python -c "from models import Creator; print([c.key for c in Creator.__table__.columns])"` includes 'hidden'
- `cd backend && alembic check` reports no pending changes (migration matches model)
- Migration file contains both schema change and data UPDATE statement

## Inputs

- ``backend/models.py` — Creator model to add hidden column to`
- ``backend/routers/creators.py` — list_creators endpoint to add filter to`

## Expected Output

- ``backend/models.py` — Creator model with hidden boolean column`
- ``backend/routers/creators.py` — list_creators filtering hidden creators`
- ``alembic/versions/*_add_creator_hidden_flag.py` — migration adding column + marking TestCreator hidden`

## Verification

cd backend && python -c "from models import Creator; print('hidden' in [c.key for c in Creator.__table__.columns])" && alembic check 2>&1 | head -5
