*
* Generated from civigrant/xml/schema/CRM/Grant/Grant.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:6572f413192bdc6c45725ba54fb7f124)
+ * (GenCodeChecksum:a3ca6da006bd1e7362988bdcbf3babdc)
*/
use CRM_Grant_ExtensionUtil as E;
/**
* Yes/No field stating whether grant report was received by donor.
*
- * @var bool|string|null
+ * @var bool|string
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => E::ts('Grant report received'),
'description' => E::ts('Yes/No field stating whether grant report was received by donor.'),
+ 'required' => TRUE,
'usage' => [
'import' => TRUE,
'export' => TRUE,
'import' => TRUE,
'where' => 'civicrm_grant.grant_report_received',
'export' => TRUE,
+ 'default' => '0',
'table_name' => 'civicrm_grant',
'entity' => 'Grant',
'bao' => 'CRM_Grant_DAO_Grant',
$params['id'] = $this->_id;
if (empty($params['grant_report_received'])) {
- $params['grant_report_received'] = "null";
+ $params['grant_report_received'] = 0;
}
// set the contact, when contact is selected
->execute();
}
+ public function upgrade_1001(): bool {
+ $this->ctx->log->info('Applying Update 1001 - fixing database column for grant_report_received to default to 0 and be required');
+ CRM_Core_DAO::executeQuery("UPDATE civicrm_grant SET grant_report_received = 0 WHERE grant_report_received IS NULL");
+ CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_grant CHANGE `grant_report_received` `grant_report_received` tinyint NOT NULL DEFAULT 0 COMMENT 'Yes/No field stating whether grant report was received by donor.'");
+ return TRUE;
+ }
+
}
`decision_date` date COMMENT 'Date on which grant decision was made.',
`money_transfer_date` date COMMENT 'Date on which grant money transfer was made.',
`grant_due_date` date COMMENT 'Date on which grant report is due.',
- `grant_report_received` tinyint COMMENT 'Yes/No field stating whether grant report was received by donor.',
+ `grant_report_received` tinyint NOT NULL DEFAULT 0 COMMENT 'Yes/No field stating whether grant report was received by donor.',
`grant_type_id` int unsigned NOT NULL COMMENT 'Type of grant. Implicit FK to civicrm_option_value in grant_type option_group.',
`amount_total` decimal(20,2) NOT NULL COMMENT 'Requested grant amount, in default currency.',
`amount_requested` decimal(20,2) COMMENT 'Requested grant amount, in original currency (optional).',
<type>boolean</type>
<comment>Yes/No field stating whether grant report was received by donor.</comment>
<import>true</import>
+ <required>true</required>
+ <default>0</default>
<add>1.8</add>
<html>
<type>CheckBox</type>