Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up fixes on population of new civicrm_mailing fields #30648

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

This is a follow on to #30458
After deploying the rc on our staging I discovered a couple of gaps

  1. the status field has a default value in the schema but not the upgrade script
  2. some of our older mailings were completed (as evidenced by having all their records in civicrm_mailing_job set to 'Complete' but the is_completed field was not set to TRUE

Before

some rows had status of NULL after the upgrade

After

  • the default value is fixed
  • the upgrade script is fixed to work if the pre-existing values are NULL rather than status
  • the upgrade script runs again for sites which upgraded to the rc and did not get all the rows upgraded
  • there is a catch at the end of the upgrade script to pick up those that were completed but have not resolved to be so.

Technical Details

There was no noticeable time cost running this script on our staging site - unlike the the prior mailing table upgrades this script deals with the number of mailings & mailing jobs, not the recipients.

Comments

Copy link

civibot bot commented Jul 10, 2024

🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷

Introduction for new contributors...
  • If this is your first PR, an admin will greenlight automated testing with the command ok to test or add to whitelist.
  • A series of tests will automatically run. You can see the results at the bottom of this page (if there are any problems, it will include a link to see what went wrong).
  • A demo site will be built where anyone can try out a version of CiviCRM that includes your changes.
  • If this process needs to be repeated, an admin will issue the command test this please to rerun tests and build a new demo site.
  • Before this PR can be merged, it needs to be reviewed. Please keep in mind that reviewers are volunteers, and their response time can vary from a few hours to a few weeks depending on their availability and their knowledge of this particular part of CiviCRM.
  • A great way to speed up this process is to "trade reviews" with someone - find an open PR that you feel able to review, and leave a comment like "I'm reviewing this now, could you please review mine?" (include a link to yours). You don't have to wait for a response to get started (and you don't have to stop at one!) the more you review, the faster this process goes for everyone 😄
  • To ensure that you are credited properly in the final release notes, please add yourself to contributor-key.yml
  • For more information about contributing, see CONTRIBUTING.md.
Quick links for reviewers...

➡️ Online demo of this PR 🔗

@civibot civibot bot added the 5.76 label Jul 10, 2024
wmfgerrit pushed a commit to wikimedia/wikimedia-fundraising-crm that referenced this pull request Jul 10, 2024
https: //github.com/civicrm/civicrm-core/pull/30648

Bug: T368999

Change-Id: I8583387732bddf61255572e26726a4097b9c4744
@@ -33,7 +33,7 @@ public function upgrade_5_76_alpha1($rev): void {
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Add start_date to civicrm_mailing table', 'addColumn', 'civicrm_mailing', 'start_date', "timestamp NULL DEFAULT NULL COMMENT 'date on which this mailing was started.'");
$this->addTask('Add end_date to civicrm_mailing table', 'addColumn', 'civicrm_mailing', 'end_date', "timestamp NULL DEFAULT NULL COMMENT 'date on which this mailing was completed.'");
$this->addTask('Add status to civicrm_mailing table', 'addColumn', 'civicrm_mailing', 'status', "varchar(12) DEFAULT NULL COMMENT 'The status of this Mailing'");
$this->addTask('Add status to civicrm_mailing table', 'addColumn', 'civicrm_mailing', 'status', "varchar(12) DEFAULT 'Draft' COMMENT 'The status of this Mailing'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the length be 12 or 32? In a stock 5.76 install it's 32, although oddly has maxlength 12:

'sql_type' => 'varchar(32)',
'description' => ts('The status of this mailing'),
'maxlength' => 12,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@demeritcowboy OK - I'll go with 32 for maxlength & here - seems like that makes sense

@demeritcowboy demeritcowboy merged commit 6489669 into civicrm:5.76 Jul 25, 2024
1 check passed
@eileenmcnaughton eileenmcnaughton deleted the missed branch July 25, 2024 23:28
@eileenmcnaughton
Copy link
Contributor Author

thanks @demeritcowboy

@demeritcowboy
Copy link
Contributor

This has been confusing me since yesterday as to why it wasn't crashing for me earlier. It does appear that at one point this PR had m. on the field names: 0eaa45a. Possibly in the final rebase it got lost? That would explain it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants