Merge pull request #23227 from eileenmcnaughton/inbetween_4
[civicrm-core.git] / CRM / Upgrade / Incremental / sql / 5.50.alpha1.mysql.tpl
1 {* file to handle db changes in 5.50.alpha1 during upgrade *}
2
3 CREATE TABLE `civicrm_user_job` (
4 `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Job ID',
5 `name` varchar(64) COMMENT 'Unique name for job.',
6 `created_id` int unsigned COMMENT 'FK to contact table.',
7 `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Date and time this job was created.',
8 `start_date` timestamp NULL COMMENT 'Date and time this import job started.',
9 `end_date` timestamp NULL COMMENT 'Date and time this import job ended.',
10 `expires_date` timestamp NULL COMMENT 'Date and time to clean up after this import job (temp table deletion date).',
11 `status_id` int unsigned NOT NULL,
12 `type_id` int unsigned NOT NULL,
13 `queue_id` int unsigned COMMENT 'FK to Queue',
14 `metadata` text COMMENT 'Data pertaining to job configuration',
15 PRIMARY KEY (`id`),
16 UNIQUE INDEX `UI_name`(name),
17 CONSTRAINT FK_civicrm_user_job_created_id FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL,
18 CONSTRAINT FK_civicrm_user_job_queue_id FOREIGN KEY (`queue_id`) REFERENCES `civicrm_queue`(`id`) ON DELETE SET NULL
19 )
20 ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;