Schema - Fix boolean fields in 'Mailing'
authorMonish Deb <monish.deb@jmaconsulting.biz>
Fri, 8 Apr 2022 01:12:17 +0000 (18:12 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 8 Apr 2022 01:12:17 +0000 (18:12 -0700)
CRM/Mailing/DAO/Mailing.php
CRM/Mailing/DAO/MailingComponent.php
CRM/Mailing/DAO/MailingJob.php
CRM/Upgrade/Incremental/php/FiveFortyNine/Mailing.bool.php [new file with mode: 0644]
xml/schema/Mailing/Component.xml
xml/schema/Mailing/Mailing.xml
xml/schema/Mailing/MailingJob.xml

index 219a8c990504346ea566c65181d49bbd4eb76109..5345514b1fa560937b27405126573f2c8f65fab4 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Mailing.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:d9992e7d40fdab9d29f2a093e34aa1cb)
+ * (GenCodeChecksum:4144d565580335c15e750f73a73df644)
  */
 
 /**
@@ -209,7 +209,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Should we track URL click-throughs for this mailing?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -218,7 +218,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Should we forward replies back to the author?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -227,7 +227,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Should we enable the auto-responder?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -236,7 +236,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Should we track when recipients open/read this mailing?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -245,7 +245,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Has at least one job associated with this mailing finished?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -263,7 +263,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Overwrite the VERP address in Reply-To
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -353,7 +353,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Is this mailing archived?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -380,7 +380,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
   /**
    * Remove duplicate emails?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -805,7 +805,9 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Url Tracking'),
           'description' => ts('Should we track URL click-throughs for this mailing?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.url_tracking',
+          'default' => '0',
           'table_name' => 'civicrm_mailing',
           'entity' => 'Mailing',
           'bao' => 'CRM_Mailing_BAO_Mailing',
@@ -821,7 +823,9 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Forward Replies'),
           'description' => ts('Should we forward replies back to the author?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.forward_replies',
+          'default' => '0',
           'table_name' => 'civicrm_mailing',
           'entity' => 'Mailing',
           'bao' => 'CRM_Mailing_BAO_Mailing',
@@ -837,7 +841,9 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Auto Responder'),
           'description' => ts('Should we enable the auto-responder?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.auto_responder',
+          'default' => '0',
           'table_name' => 'civicrm_mailing',
           'entity' => 'Mailing',
           'bao' => 'CRM_Mailing_BAO_Mailing',
@@ -853,7 +859,9 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Track Mailing?'),
           'description' => ts('Should we track when recipients open/read this mailing?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.open_tracking',
+          'default' => '0',
           'table_name' => 'civicrm_mailing',
           'entity' => 'Mailing',
           'bao' => 'CRM_Mailing_BAO_Mailing',
@@ -865,7 +873,9 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Mailing Completed'),
           'description' => ts('Has at least one job associated with this mailing finished?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.is_completed',
+          'default' => '0',
           'table_name' => 'civicrm_mailing',
           'entity' => 'Mailing',
           'bao' => 'CRM_Mailing_BAO_Mailing',
@@ -896,6 +906,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Override Verp'),
           'description' => ts('Overwrite the VERP address in Reply-To'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.override_verp',
           'default' => '0',
           'table_name' => 'civicrm_mailing',
@@ -1068,6 +1079,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Is Mailing Archived?'),
           'description' => ts('Is this mailing archived?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.is_archived',
           'default' => '0',
           'table_name' => 'civicrm_mailing',
@@ -1129,6 +1141,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('No Duplicate emails?'),
           'description' => ts('Remove duplicate emails?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing.dedupe_email',
           'default' => '0',
           'table_name' => 'civicrm_mailing',
index 0f77ebdfb50f1caad629618cf597d6186d77e55a..44509bb0e5802e62faeebbab416c309de0a553e7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/MailingComponent.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:07a2027aee545a570c9fd99294f98d9a)
+ * (GenCodeChecksum:0714e4996da6d79fc972efe53df08a26)
  */
 
 /**
@@ -84,7 +84,7 @@ class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
   /**
    * Is this the default component for this component_type?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -93,7 +93,7 @@ class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
   /**
    * Is this property active?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -231,6 +231,7 @@ class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Mailing Component is Default?'),
           'description' => ts('Is this the default component for this component_type?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing_component.is_default',
           'default' => '0',
           'table_name' => 'civicrm_mailing_component',
@@ -244,7 +245,9 @@ class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Mailing Component Is Active?'),
           'description' => ts('Is this property active?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing_component.is_active',
+          'default' => '1',
           'table_name' => 'civicrm_mailing_component',
           'entity' => 'MailingComponent',
           'bao' => 'CRM_Mailing_BAO_MailingComponent',
index 3ba252d04082e85f77212e577f6bf7393a242968..3f366c0dbc8bc9c26f9976e43c21bef250d6fcc6 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/MailingJob.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:fdca7fda2701c59049924abfdb6adf3b)
+ * (GenCodeChecksum:492e51f255632b9c3d87714bc9ca0f4d)
  */
 
 /**
@@ -86,7 +86,7 @@ class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO {
   /**
    * Is this job for a test mail?
    *
-   * @var bool|string|null
+   * @var bool|string
    *   (SQL type: tinyint)
    *   Note that values will be retrieved from the database as a string.
    */
@@ -283,6 +283,7 @@ class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Mailing Job Is Test?'),
           'description' => ts('Is this job for a test mail?'),
+          'required' => TRUE,
           'where' => 'civicrm_mailing_job.is_test',
           'default' => '0',
           'table_name' => 'civicrm_mailing_job',
diff --git a/CRM/Upgrade/Incremental/php/FiveFortyNine/Mailing.bool.php b/CRM/Upgrade/Incremental/php/FiveFortyNine/Mailing.bool.php
new file mode 100644 (file)
index 0000000..bb37d5c
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+return [
+  'civicrm_mailing' => [
+    'url_tracking' => "DEFAULT 0 COMMENT 'Should we track URL click-throughs for this mailing?'",
+    'forward_replies' => "DEFAULT 0 COMMENT 'Should we forward replies back to the author?'",
+    'auto_responder' => "DEFAULT 0 COMMENT 'Should we enable the auto-responder?'",
+    'open_tracking' => "DEFAULT 0 COMMENT 'Should we track when recipients open/read this mailing?'",
+    'is_completed' => "DEFAULT 0 COMMENT 'Has at least one job associated with this mailing finished?'",
+    'override_verp' => "DEFAULT 0 COMMENT 'Overwrite the VERP address in Reply-To'",
+    'is_archived' => "DEFAULT 0 COMMENT 'Is this mailing archived?'",
+    'dedupe_email' => "DEFAULT 0 COMMENT 'Remove duplicate emails?'",
+  ],
+  'civicrm_mailing_job' => [
+    'is_test' => "DEFAULT 0 COMMENT 'Is this job for a test mail?'",
+  ],
+  'civicrm_mailing_component' => [
+    'is_active' => "DEFAULT 1 COMMENT 'Is this property active?'",
+  ],
+];
index 54788c45ce85c47cb7994cfc4a4fea643114d20b..a716253366b24df84a683c7ecd7ab609a403c268 100644 (file)
     <title>Mailing Component is Default?</title>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <comment>Is this the default component for this component_type?</comment>
   </field>
   <field>
     <name>is_active</name>
     <title>Mailing Component Is Active?</title>
     <type>boolean</type>
+    <required>true</required>
+    <default>1</default>
     <comment>Is this property active?</comment>
   </field>
 </table>
index f7a9ebb848e5ef0137d656e6f238e86a7431ec62..666cf4e29acab164beced9c5050aa2e8ded113af 100644 (file)
   <field>
     <name>url_tracking</name>
     <type>boolean</type>
+    <default>0</default>
+    <required>true</required>
     <comment>Should we track URL click-throughs for this mailing?</comment>
     <html>
       <type>CheckBox</type>
   <field>
     <name>forward_replies</name>
     <type>boolean</type>
+    <default>0</default>
+    <required>true</required>
     <comment>Should we forward replies back to the author?</comment>
     <html>
       <type>CheckBox</type>
   <field>
     <name>auto_responder</name>
     <type>boolean</type>
+    <default>0</default>
+    <required>true</required>
     <comment>Should we enable the auto-responder?</comment>
     <html>
       <type>CheckBox</type>
     <name>open_tracking</name>
     <title>Track Mailing?</title>
     <type>boolean</type>
+    <default>0</default>
+    <required>true</required>
     <comment>Should we track when recipients open/read this mailing?</comment>
   </field>
   <field>
     <name>is_completed</name>
     <title>Mailing Completed</title>
     <type>boolean</type>
+    <default>0</default>
+    <required>true</required>
     <comment>Has at least one job associated with this mailing finished?</comment>
     <html>
       <type>CheckBox</type>
     <name>override_verp</name>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <add>2.2</add>
     <comment>Overwrite the VERP address in Reply-To</comment>
     <html>
     <type>boolean</type>
     <title>Is Mailing Archived?</title>
     <default>0</default>
+    <required>true</required>
     <comment>Is this mailing archived?</comment>
     <html>
       <type>CheckBox</type>
     <type>boolean</type>
     <title>No Duplicate emails?</title>
     <default>0</default>
+    <required>true</required>
     <add>4.1</add>
     <comment>Remove duplicate emails?</comment>
     <html>
index d657c80011f72cbf2648fad8f03b971e13d3b9e2..eb728a6aa0a2e5d2c3c8893d82756827b3a6050e 100644 (file)
@@ -93,6 +93,7 @@
     <title>Mailing Job Is Test?</title>
     <type>boolean</type>
     <default>0</default>
+    <required>true</required>
     <comment>Is this job for a test mail?</comment>
     <add>1.9</add>
   </field>