Extract subscribers to a separate table in the Bounce worker [MAILPOET-940]

This commit is contained in:
stoletniy
2017-07-11 16:30:44 +03:00
parent b24c51d800
commit 6a9b8d88c2
8 changed files with 162 additions and 83 deletions

View File

@@ -18,6 +18,7 @@ class Migrator {
'settings',
'custom_fields',
'scheduled_tasks',
'scheduled_task_subscribers',
'sending_queues',
'subscribers',
'subscriber_segment',
@@ -109,12 +110,8 @@ class Migrator {
$attributes = array(
'id mediumint(9) NOT NULL AUTO_INCREMENT,',
'type varchar(90) NULL DEFAULT NULL,',
'subscribers longtext,',
'status varchar(12) NULL DEFAULT NULL,',
'priority mediumint(9) NOT NULL DEFAULT 0,',
'count_total mediumint(9) NOT NULL DEFAULT 0,',
'count_processed mediumint(9) NOT NULL DEFAULT 0,',
'count_to_process mediumint(9) NOT NULL DEFAULT 0,',
'scheduled_at TIMESTAMP NULL,',
'processed_at TIMESTAMP NULL,',
'created_at TIMESTAMP NULL,',
@@ -125,6 +122,17 @@ class Migrator {
return $this->sqlify(__FUNCTION__, $attributes);
}
function scheduledTaskSubscribers() {
$attributes = array(
'task_id mediumint(9) NOT NULL,',
'subscriber_id mediumint(9) NOT NULL,',
'processed int(1) NULL,',
'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
'PRIMARY KEY (task_id, subscriber_id)',
);
return $this->sqlify(__FUNCTION__, $attributes);
}
function sendingQueues() {
$attributes = array(
'id mediumint(9) NOT NULL AUTO_INCREMENT,',