HomePhabricator

Add artificial primary key to flow_wiki_ref and flow_ext_ref

Authored by matthiasmullie.

Description

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
new)

Deployment plan:

  • 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)

Bug: T109676
Change-Id: Icd1673ed642efc838809ae249f9544a364962886