3,184sales rows 3,103write 46held 1,882new facilities 2,834new people

3,775patients 10patients held 171rows reuse a facility prod has Notion dump of 2026-08-13 / 3,715 prod master records

0. Where we arewhat has been written, and what has not

WhenWhereWhatResult
Aug 20prodScope 1 — sales for CL6, CL8–CL12 1,910 sales rows / 524 people / 33 facilities written
Aug 20prodScope 1.5 — duplicate master records merged 22 facilities / 44 people / 27 patients merged
Aug 20devTrial write on the code of the day A different thing from today's code (CL1 wrote 24 rows then, 287 now)
Aug 26devScope 2 — all six clinics, one run each 2,903 sales / 1,407 facilities / 1,712 people. One journal per clinic
Aug 26prodScope 2 not one row written yet

Dev is written. Prod is not. One clinic per run, each with a journal to undo it. Running all six at once is refused by the code.

1. What a run would doa dry run from run `salesmig plan` to refresh — nothing was written to prod

Click a clinic: one tab per kind, filters, and a row that opens to show what it writes. Answer it there.

Of 3,184 sales rows, 3,103 write, 46 held. Held is not lost — the next run picks them up.

#ClinicSales rowsWriteHeld New facilitiesNew peopleStateWhy this order
1CL1 渋谷3393321328464ready to runFirst, by agreement. 287 of 295 sales rows and 1,076 of 1,095 patients write
2CL2 吉川2972933273447ready to run984 of 997 patients write. Waiting on nobody
3CL3 白井19318111158307ready to run563 of 569 patients write. Waiting on nobody
4CL4 足立1601545231315ready to runFacility names re-read through the API; holds went 417 to 5
5CL5 成増1,3961,3699557753ready to runLargest sales clinic at 1,301 rows. Every patient writes
6CL7 武蔵小金井79977417335548ready to run216 of 217 patients write. Its facility comes from the referrer

CL1 渋谷 is ready. The only thing it waits on is permission to start.

Measured by running salesmig migrate --target prod --clinic <CL> (one per run). The Notion page id is the document id, so a second run creates nothing twice.

2. Decidedsettled by Akira on Aug 24 — not asked again

QuestionWhoAnswerWhat it changed
Run orderAkiraCL1 firstThe table above follows it
Where patient data livesAkiraFrom Notion3,697 rows confirmed across the six clinics (section 3.5)
Facilities with no addressAkiraCreate them without an address280 name-only facilities now get created. Holds fell 676 to 218
Address differs between Notion and prodAkiraNotion winsEven when a row matches a prod record, the address comes from Notion
CL4's blank title columnResolved hereRe-read through the Notion API122 pages read one at a time. CL4 holds fell 153 to 12

"Create them without an address" alone took holds 676 → 46, with three matching fixes alongside it.

3. Why 46 rows are heldwhat each group needs to clear

ReasonRowsWhereHow it clears
担当者名 is empty27CL1 1 / CL2 3 / CL3 10 / CL4 5 / CL5 3 / CL7 5Answered by the clinic
The 事業所 page it points at has no name14CL4 4 / CL7 10Answered by the clinic
Two or more prod facilities carry the name9CL2 4 / CL3 2 / CL4 1 / CL5 2Answered by a reviewer
The row reaches no 事業所 at all5CL5 3 / CL7 2Answered by the clinic
The 事業所 page is not in our download1CL5 1Answered by us

CL4 is unblocked. Its title column is nameless in SQL but the API returns it per page, so we re-read the 122 facilities its sales rows reach: held 153 → 12.

Every held row is on its clinic's page under You decide or The clinic fixes, and the ones only a reviewer can answer are collected on the decisions page, asked once each rather than once per row.

3.5 Patientsbuilt 3,775 write, 10 held across 6 of 6 clinics

Scope 2 is four things — facilities, people, patients, sales. The numbers above are the first three; patients now have a run of their own, salesmig patients --target prod --clinic <CL>. A patient points at a facility and at a person, so it runs after them and reuses whatever they created rather than making a second copy.

ClinicNotion databaseRows WriteHeldState
CL1 渋谷利用者リスト_SS_new1,0951,0900dry run done
CL2 吉川患者DB_吉川9979944dry run done
CL4 足立患者DB_足立6346305dry run done
CL3 白井患者DB_白井5696571dry run done
CL7 武蔵小金井患者DB_武蔵小金井2172190dry run done
CL5 成増患者DB_成増1851850dry run done

Bank details do not migrate. prod's patients has 26 fields and none is an account number, bank code, branch or holder — nowhere to put them, so they stay in Notion. 病名, 病歴, ADL and 生年月日 do have fields.

How much arrives is another matter: most clinics leave the clinical columns near-empty, and CL1 has no 要支援・要介護 column at all. Each clinic's page shows what is filled in.

4. Needs a decisionanswerable here, right now

Picks save as you make them. Anyone with this page open sees them.

Start writing to prod with CL1? All six are already in dev. Held is not lost — the next run picks it up.Akira / Kotaro

Which hospital is CL1's person record 病院連携室? Naming it clears 6 of CL1's 8 held rows.Kotaro / the CL1 sales rep

Patients: 3,697 rows, 2,131 with a bank account number, plus 病名, 病歴, ADL and date of birth. Nothing builds them yet.Akira / Kotaro

17 rows (8 names) match two or more prod facilities. Pick page ready, about a minute → /scope2_pick.htmlKotaro

カワウチ splits across two people. Does the 2025-09-10 sales row belong to アキコ or ショウコ?Kotaro

11 CL7 rows all point at one unnamed Notion page shared by 14 people from at least three different organizations (府中市地域包括支援センターあしたて, ホームステーション三鷹, リリィパワーズレジデンス武蔵野 and more). It is a placeholder, not a facility.Kotaro / the CL7 sales rep

49 rows identify neither facility nor person: 33 name-is-neither, 14 no facility link, 2 outside the dump.Kotaro