Integrations.type migration: 3 - Copy PG triggers that maintain `has_external_wiki`, and drop old ones
About
This issue is part of &6177 (closed). See that Epic for a broader description of the feature.
There are currently some PG triggers that maintain the projects.has_external_wiki
cache in !49916 (merged).
The triggers contain WHEN
clauses for when type = 'ExternalWikiService'
, these will need to be changed to trigger when type_new = 'Integrations::ExternalWiki'
instead.
The process for this would be to drop the old triggers and recreate new triggers. This will need to be done inside a transaction. As there will be other triggers maintaining the type_new
values (#333506 (closed)) the caches should continue to work as before.
(Note: A related trigger !51852 (merged) operates on the category
column so does not need to be updated).
Edited by Markus Koller