Page MenuHomePhabricator

FR-Tech FY2324Q2 maintenance window
Closed, ResolvedPublic0 Estimated Story Points

Description

Here are tasks that are set to be completed during the q2 maintenance window.

Dates: October 30, 2023 - November 3, 2023
Asana task: https://app.asana.com/0/1125967519298615/1204682488550226/f

UPDATE civicrm_contribution SET tax_amount = 0 WHERE tax_amount IS NULL; UPDATE civicrm_line_item SET tax_amount = 0 WHERE tax_amount IS NULL;

Mailing column sql

-- around 15-20 mins
ALTER TABLE civicrm_mailing_event_queue MODIFY job_id int unsigned null comment 'Mailing Job',
ADD COLUMN mailing_id int(10) unsigned DEFAULT NULL COMMENT 'Related mailing. Used for reporting on mailing success, if present.',
ADD CONSTRAINT FOREIGN KEY (`mailing_id`)
REFERENCES `civicrm_mailing` (`id`) ON DELETE SET NULL,
ADD COLUMN is_test tinyint(4) NOT NULL DEFAULT 0,
DROP FOREIGN KEY FK_civicrm_mailing_event_queue_job_id;

-- around 15-20 mins
ALTER TABLE `civicrm_mailing_event_queue`
ADD CONSTRAINT `FK_civicrm_mailing_event_queue_job_id`
FOREIGN KEY (`job_id`)
REFERENCES `civicrm_mailing_job`(`id`) ON DELETE SET NULL;

-- around 20 mins
UPDATE  civicrm_mailing_event_queue q
INNER JOIN civicrm_mailing_job job ON job.id = q.job_id
SET q.mailing_id = job.mailing_id, q.is_test=job.is_test
WHERE q.mailing_id IS NULL;

Event Timeline

greg triaged this task as Medium priority.
Eileenmcnaughton updated the task description. (Show Details)
Eileenmcnaughton updated the task description. (Show Details)
Dwisehaupt subscribed.

Moving to sprint +2 since it's in the time window now.

Dwisehaupt set the point value for this task to 0.Oct 12 2023, 4:00 PM
Jgreen updated the task description. (Show Details)

First mailing column sql query successful.

MariaDB [civicrm]> ALTER TABLE civicrm_mailing_event_queue MODIFY job_id int unsigned null comment 'Mailing Job',
    -> ADD COLUMN mailing_id int(10) unsigned DEFAULT NULL COMMENT 'Related mailing. Used for reporting on mailing success, if present.',
    -> ADD CONSTRAINT FOREIGN KEY (`mailing_id`)
    -> REFERENCES `civicrm_mailing` (`id`) ON DELETE SET NULL,
    -> ADD COLUMN is_test tinyint(4) NOT NULL DEFAULT 0,
    -> DROP FOREIGN KEY FK_civicrm_mailing_event_queue_job_id;
Query OK, 2038692 rows affected (33.980 sec)           
Records: 2038692  Duplicates: 0  Warnings: 0

Second mailing column sql query successful.

MariaDB [civicrm]> ALTER TABLE `civicrm_mailing_event_queue`
    -> ADD CONSTRAINT `FK_civicrm_mailing_event_queue_job_id`
    -> FOREIGN KEY (`job_id`)
    -> REFERENCES `civicrm_mailing_job`(`id`) ON DELETE SET NULL;
Query OK, 2038707 rows affected (36.406 sec)           
Records: 2038707  Duplicates: 0  Warnings: 0

Third mailing column sql query successful.

MariaDB [civicrm]> UPDATE  civicrm_mailing_event_queue q
    -> INNER JOIN civicrm_mailing_job job ON job.id = q.job_id
    -> SET q.mailing_id = job.mailing_id, q.is_test=job.is_test
    -> WHERE q.mailing_id IS NULL;
Query OK, 2038707 rows affected (1 min 17.252 sec)
Rows matched: 2038707  Changed: 2038707  Warnings: 0

All queries for that step done.

Eileenmcnaughton updated the task description. (Show Details)
Eileenmcnaughton updated the task description. (Show Details)
Eileenmcnaughton updated the task description. (Show Details)

Tax amount queries complete:

UPDATE civicrm_contribution SET tax_amount = 0 WHERE tax_amount IS NULL;

Query OK, 60335508 rows affected (3 hours 29 min 21.220 sec)
Rows matched: 60335508  Changed: 60335508  Warnings: 0
UPDATE civicrm_line_item SET tax_amount = 0 WHERE tax_amount IS NULL;

Query OK, 60306631 rows affected (24 min 19.700 sec)
Rows matched: 60306631  Changed: 60306631  Warnings: 0

The civicrm_contribution update was expensive due to creating entries in the log tables for each update.

XenoRyet set Final Story Points to 0.
XenoRyet closed subtask T350208: CiviCRM point release as Resolved.