set is_deceased to not null in schema and upgrade script
Over the past few years, compelling evidence has has emerged to suggest that Zombies do exist in CiviCRM databases. Here are a couple of the most high profile cases:
- https://civicrm.org/extensions/zombie-check
- https://civicrm.org/blog/simonparkervitiligosocietyorguk/solution-all-recipients-not-showing-up-for-sending-mass-email
Whilst various attempts have been made to eliminate the scourge of zombies once and for ever, the most notable of which being https://lab.civicrm.org/dev/core/-/blob/master/CRM/Upgrade/Incremental/sql/4.7.beta2.mysql.tpl#L15-17 ...
-- CRM-17147 People with empty deceased-flag ('is null') get removed from recipient list of a mailing
UPDATE civicrm_contact SET is_deceased = 0 WHERE is_deceased IS NULL;
ALTER TABLE civicrm_contact ALTER COLUMN is_deceased SET DEFAULT 0;
... it has come to light that Zombies persist across CiviCRM instances.
Although the upgrade script defaults all existing fields to 0, and new sites have a default of 0, this does not prevent the columns from being asssigned a null value.
PR here that alters the definition for new tables and adds another upgrade step: https://github.com/civicrm/civicrm-core/pull/17025