Add artificial primary key to flow_wiki_ref and flow_ext_ref
The newly added ref_id is not used in the code, it's
only meant to make DB maintenance easier.
There shouldn't be any conflicts with old/new records being
confused with each other since the code is mostly unaware
of this ID: it still uses all the other columns as "fake"
PK (to compare records when figuring out if references are
- Run db-patches/patch-ref_id-phase1.sql (prepare schema)
- Merge & deploy this code (start writing to ref_id)
- Run maintenance/FlowPopulateRefId.php (migrate existing ref_id)
- Run db-patches/patch-ref_id-phase2.sql (make not null & PK)