civicrm / org.civicrm.doctorwhen

Doctor When: Temporal cleanup agent
Other
2 stars 9 forks source link

Allow for default to be NULL and also allow for comments to be added … #6

Closed seamuslee001 closed 6 years ago

seamuslee001 commented 6 years ago

…to columns

this should resolve #5

seamuslee001 commented 6 years ago

I ran the test on a local 47 db before the table was

| Table                       | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| civicrm_mailing_event_reply | CREATE TABLE `civicrm_mailing_event_reply` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `event_queue_id` int(10) unsigned NOT NULL COMMENT 'FK to EventQueue',
  `time_stamp` datetime NOT NULL COMMENT 'When this reply event occurred.',
  PRIMARY KEY (`id`),
  KEY `FK_civicrm_mailing_event_reply_event_queue_id` (`event_queue_id`),
  CONSTRAINT `FK_civicrm_mailing_event_reply_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

After

mysql> show create table civicrm_mailing_event_reply;
+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table                       | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| civicrm_mailing_event_reply | CREATE TABLE `civicrm_mailing_event_reply` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `event_queue_id` int(10) unsigned NOT NULL COMMENT 'FK to EventQueue',
  `time_stamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When this reply event occurred.',
  PRIMARY KEY (`id`),
  KEY `FK_civicrm_mailing_event_reply_event_queue_id` (`event_queue_id`),
  CONSTRAINT `FK_civicrm_mailing_event_reply_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

This was also applying the core patch as well. This was with the following sql modes being used


ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION```
adanielvv commented 6 years ago

Fixes #7.

MegaphoneJon commented 6 years ago

I just tested this with Civi 4.7.27 and confirm it fixes #5 as well.

totten commented 6 years ago

Thank you @seamuslee001 for fixing! I'm merging since @DanielvV and @MegaphoneJon both give it 👍.

Wish I'd given this a go a bit sooner -- sounds like another person got bit.