Skip to content

Add cc as a feeding amount unit - #290

Merged
mike12806 merged 1 commit into
mainfrom
claude/breastfeeding-cc-unit-tdvlyo
Aug 5, 2026
Merged

Add cc as a feeding amount unit#290
mike12806 merged 1 commit into
mainfrom
claude/breastfeeding-cc-unit-tdvlyo

Conversation

@mike12806

Copy link
Copy Markdown
Owner

Adds cc as an amount unit for feedings, in addition to the existing oz, ml and g.

Changes

  • server/migrations/0010_add_cc_feeding_unit.sql (new) — widens the feedings.amount_unit CHECK constraint to ('ml', 'oz', 'g', 'cc'). SQLite can't alter a CHECK constraint in place, so the migration rebuilds the table and copies rows across, following the same pattern as migration 0008. Existing rows are preserved unchanged and the two indexes are recreated.
  • client/src/types/models.tsFeeding.amount_unit union now includes "cc".
  • client/src/pages/FeedingsPage.tsxcc added to the unit dropdown on the add/edit feeding form (between ml and g).
  • client/src/components/QuickLogDialog.tsx — same option added to the feeding quick-log form.
  • server/test/helpers.ts — registers migration 0010 so the test schema stays in sync with production.
  • server/test/feedings.test.ts — new test asserting POST /api/feedings accepts and round-trips amount_unit: "cc".

Notes

  • Pumping amounts still allow only oz/ml — that's a separate table and constraint, and this change was scoped to feedings.
  • The existing "today's total" tiles and charts sum only oz entries; cc entries are excluded from those totals the same way ml and g entries already are. No unit conversion was introduced.

Testing

  • npm test -w server — 75 tests pass (8 files)
  • npm test -w client — 84 tests pass (11 files)
  • npm run build -w client — succeeds

Generated by Claude Code

Adds "cc" alongside oz, ml and g for feeding amounts. SQLite can't alter
a CHECK constraint in place, so migration 0010 rebuilds the feedings
table with the widened amount_unit constraint.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DQq4Xb6iq9ZJfPzs7afSvY
@mike12806
mike12806 marked this pull request as ready for review August 5, 2026 11:14
@mike12806
mike12806 merged commit afbf554 into main Aug 5, 2026
6 checks passed
@mike12806
mike12806 deleted the claude/breastfeeding-cc-unit-tdvlyo branch August 5, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants