diff --git a/CRM/Mailing/DAO/Mailing.php b/CRM/Mailing/DAO/Mailing.php index 24666f8b5894..1ca7c178abae 100644 --- a/CRM/Mailing/DAO/Mailing.php +++ b/CRM/Mailing/DAO/Mailing.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Mailing/Mailing.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:a2d71da677efc3436ae8ed9414cdecca) + * (GenCodeChecksum:4c28acf96d01fa990a3af7f2d72344b5) */ /** @@ -844,7 +844,7 @@ public static function &fields() { 'description' => ts('Date and time this mailing was created.'), 'required' => FALSE, 'where' => 'civicrm_mailing.created_date', - 'default' => 'NULL', + 'default' => 'CURRENT_TIMESTAMP', 'table_name' => 'civicrm_mailing', 'entity' => 'Mailing', 'bao' => 'CRM_Mailing_BAO_Mailing', diff --git a/CRM/Upgrade/Incremental/sql/5.40.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.40.alpha1.mysql.tpl index 6a2df9741d22..3841afccc594 100644 --- a/CRM/Upgrade/Incremental/sql/5.40.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.40.alpha1.mysql.tpl @@ -10,3 +10,6 @@ UPDATE civicrm_option_value SET name = 'Case' WHERE value = 'civicrm_case' AND option_group_id = @option_group_id_tuf; UPDATE civicrm_option_value SET name = 'File' WHERE value = 'civicrm_file' AND option_group_id = @option_group_id_tuf; + +ALTER TABLE civicrm_mailing +MODIFY COLUMN `created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Date and time this mailing was created.'; diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index 0632c649c440..72e69c4762d1 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -285,11 +285,6 @@ public function createContainer() { $container->setDefinition('cache_config', new Definition('ArrayObject')) ->setFactory([new Reference(self::SELF), 'createCacheConfig'])->setPublic(TRUE); - $container->setDefinition('civi.mailing.triggers', new Definition( - 'Civi\Core\SqlTrigger\TimestampTriggers', - ['civicrm_mailing', 'Mailing'] - ))->addTag('kernel.event_listener', ['event' => 'hook_civicrm_triggerInfo', 'method' => 'onTriggerInfo'])->setPublic(TRUE); - $container->setDefinition('civi.activity.triggers', new Definition( 'Civi\Core\SqlTrigger\TimestampTriggers', ['civicrm_activity', 'Activity'] diff --git a/xml/schema/Mailing/Mailing.xml b/xml/schema/Mailing/Mailing.xml index ca0dee584aa6..c5e65fe046cd 100644 --- a/xml/schema/Mailing/Mailing.xml +++ b/xml/schema/Mailing/Mailing.xml @@ -325,7 +325,7 @@ created_date timestamp - NULL + CURRENT_TIMESTAMP false Mailing Created Date Date and time this mailing was created.