HomePhabricator

Segregate Reference objects by source wiki.

Authored by werdna.

Description

Segregate Reference objects by source wiki.

Resolves error messages that were occurring when trying to load a
Reference object from another wiki, either because their title
normalisation rules differed (such as namespaces, as in bug 65802),
or because the Workflows refused to load (bug 65915).

In a later patch to add Flow Reference support to GlobalUsage,
the restriction on flow_wiki_ref can be relaxed.

Deployment plan:

  1. Apply patch-reference_wiki-phase1.sql (already done for WMF with

patch set 9 version).
This creates the appropriate columns and creates new indices that
include it.

  1. Apply patch-reference_wiki-phase1.5_WMF.sql (WMF only), to

add indices.

  1. Deploy code with $wgFlowMigrateReferenceWiki set.

With this change, the field will be saved, but NULL values will
be tolerated.

  1. Apply patch-reference_wiki-phase2.sql

This patch will back-fill the field.
It must be run repeatedly until 0 rows are affected for all the
updates.

  1. Apply patch-reference_wiki-phase3.sql

This patch will set the columns NOT NULL and drop the old indices

  1. Turn off $wgFlowMigrateReferenceWiki.

This also adjusts flow.sql to be consistent with the DB
patch in 873cbbca3e614a7f5d3c39d91cbe1769687f6c8a in regards
to non-unique indices and ref_target type.

Also, a change to how that patch is detected, so it should
work for both fresh installs and anyone who still has that
really old key name.

Bug: T107204
Bug: T67915
Bug: T67802
Change-Id: I9472361425897fe8d8ad173663d0e2cb7dec4ab2