*
* Generated from xml/schema/CRM/Core/Country.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:baa7ed7cb183bc7f1ee86a41a001e580)
+ * (GenCodeChecksum:a2520444699acbd151d715ccadc6e2b7)
*/
/**
*/
public $is_province_abbreviated;
+ /**
+ * Is this Country active?
+ *
+ * @var bool
+ */
+ public $is_active;
+
/**
* Class constructor.
*/
'localizable' => 0,
'add' => '3.1',
],
+ 'is_active' => [
+ 'name' => 'is_active',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('Country Is Active'),
+ 'description' => ts('Is this Country active?'),
+ 'where' => 'civicrm_country.is_active',
+ 'default' => '1',
+ 'table_name' => 'civicrm_country',
+ 'entity' => 'Country',
+ 'bao' => 'CRM_Core_BAO_Country',
+ 'localizable' => 0,
+ 'add' => '5.35',
+ ],
];
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
*
* Generated from xml/schema/CRM/Core/County.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:9e49f92ab040fc02002d5ec5507cf49a)
+ * (GenCodeChecksum:5626c0a01aa4e5da8dedc064ce3a9dff)
*/
/**
*/
public $state_province_id;
+ /**
+ * Is this County active?
+ *
+ * @var bool
+ */
+ public $is_active;
+
/**
* Class constructor.
*/
],
'add' => '1.1',
],
+ 'is_active' => [
+ 'name' => 'is_active',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('County Is Active'),
+ 'description' => ts('Is this County active?'),
+ 'where' => 'civicrm_county.is_active',
+ 'default' => '1',
+ 'table_name' => 'civicrm_county',
+ 'entity' => 'County',
+ 'bao' => 'CRM_Core_DAO_County',
+ 'localizable' => 0,
+ 'add' => '5.35',
+ ],
];
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
*
* Generated from xml/schema/CRM/Core/StateProvince.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:abd329da6e7801c901c3c97c1b09ef59)
+ * (GenCodeChecksum:92fa37e3fe2a55ec5b0efc3fc220ac4f)
*/
/**
*/
public $country_id;
+ /**
+ * Is this StateProvince active?
+ *
+ * @var bool
+ */
+ public $is_active;
+
/**
* Class constructor.
*/
'FKClassName' => 'CRM_Core_DAO_Country',
'add' => '1.1',
],
+ 'is_active' => [
+ 'name' => 'is_active',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('StateProvince Is Active'),
+ 'description' => ts('Is this StateProvince active?'),
+ 'where' => 'civicrm_state_province.is_active',
+ 'default' => '1',
+ 'table_name' => 'civicrm_state_province',
+ 'entity' => 'StateProvince',
+ 'bao' => 'CRM_Core_DAO_StateProvince',
+ 'localizable' => 0,
+ 'add' => '5.35',
+ ],
];
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
* (change the x in the function name):
*/
- // /**
- // * Upgrade function.
- // *
- // * @param string $rev
- // */
- // public function upgrade_5_0_x($rev) {
- // $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
- // $this->addTask('Do the foo change', 'taskFoo', ...);
- // // Additional tasks here...
- // // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
- // // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
- // }
+ /**
+ * Upgrade function.
+ *
+ * @param string $rev
+ */
+ public function upgrade_5_35_alpha1(string $rev): void {
+ $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
- // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
- // return TRUE;
- // }
+ $this->addTask('dev/core/#2329 - Add is_active to Country', 'addColumn',
+ 'civicrm_country', 'is_active', "tinyint DEFAULT 1 COMMENT 'Is this Country active?'");
+ $this->addTask('dev/core/#2329 - Add is_active to StateProvince', 'addColumn',
+ 'civicrm_state_province', 'is_active', "tinyint DEFAULT 1 COMMENT 'Is this StateProvince active?'");
+ $this->addTask('dev/core/#2329 - Add is_active to County', 'addColumn',
+ 'civicrm_county', 'is_active', "tinyint DEFAULT 1 COMMENT 'Is this County active?'");
+ }
}
<comment>Should state/province be displayed as abbreviation for contacts from this country?</comment>
<add>3.1</add>
</field>
+ <field>
+ <name>is_active</name>
+ <title>Country Is Active</title>
+ <type>boolean</type>
+ <default>1</default>
+ <comment>Is this Country active?</comment>
+ <add>5.35</add>
+ </field>
<index>
<name>UI_name_iso_code</name>
<fieldName>name</fieldName>
<key>id</key>
<add>1.1</add>
</foreignKey>
+ <field>
+ <name>is_active</name>
+ <title>County Is Active</title>
+ <type>boolean</type>
+ <default>1</default>
+ <comment>Is this County active?</comment>
+ <add>5.35</add>
+ </field>
<index>
<name>UI_name_state_id</name>
<fieldName>name</fieldName>
<key>id</key>
<add>1.1</add>
</foreignKey>
+ <field>
+ <name>is_active</name>
+ <title>StateProvince Is Active</title>
+ <type>boolean</type>
+ <default>1</default>
+ <comment>Is this StateProvince active?</comment>
+ <add>5.35</add>
+ </field>
<index>
<name>UI_name_country_id</name>
<fieldName>name</fieldName>