From 2cd5d411d4ec69864c44c0ead22c20ce4f4e3c9b Mon Sep 17 00:00:00 2001 From: Michael McAndrew Date: Wed, 8 Apr 2020 10:40:14 +0100 Subject: [PATCH] dev/core#1697 set is_deceased to not null in schema and upgrade script --- CRM/Contact/DAO/Contact.php | 3 ++- CRM/Upgrade/Incremental/sql/5.26.alpha1.mysql.tpl | 3 +++ xml/schema/Contact/Contact.xml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index e4135fe7e2..7acdddd04c 100644 --- a/CRM/Contact/DAO/Contact.php +++ b/CRM/Contact/DAO/Contact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Contact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:4b1e2ef9f5c431f59befcc000cb35577) + * (GenCodeChecksum:e811ca59eee757951e6e190a318f9749) */ /** @@ -1204,6 +1204,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'name' => 'is_deceased', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Deceased'), + 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_contact.is_deceased', 'headerPattern' => '/i(s\s)?d(eceased)$/i', diff --git a/CRM/Upgrade/Incremental/sql/5.26.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.26.alpha1.mysql.tpl index d0cf4564fd..c0277ba54f 100644 --- a/CRM/Upgrade/Incremental/sql/5.26.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.26.alpha1.mysql.tpl @@ -1 +1,4 @@ {* file to handle db changes in 5.26.alpha1 during upgrade *} + +UPDATE civicrm_contact SET is_deceased = 0 WHERE is_deceased IS NULL; +ALTER TABLE civicrm_contact MODIFY COLUMN is_deceased TINYINT NOT NULL DEFAULT 0; diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 28a2ee98f7..036ad4edd3 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -695,6 +695,7 @@ boolean 0 1.1 + true CheckBox -- 2.25.1