PMC-924 Add to schema the new tables to manage the jobs

This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-07-05 11:57:09 -04:00
parent d4c81fe47f
commit 83300a1d7c
2 changed files with 64 additions and 0 deletions

View File

@@ -5828,4 +5828,32 @@
<index-column name="SOURCE_ID"/>
</index>
</table>
<table name="JOBS_PENDING" idMethod="native">
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
<parameter name="Collation" value="utf8"/>
</vendor>
<column name="id" type="BIGINT" size="20" required="true" autoIncrement="true" primaryKey="true"/>
<column name="queue" type="VARCHAR" size="255" required="true"/>
<column name="payload" type="LONGVARCHAR" required="true"/>
<column name="attempts" type="TINYINT" size="3" required="true"/>
<column name="reserved_at" type="TINYINT" size="10" default="NULL"/>
<column name="available_at" type="TINYINT" size="10" required="true"/>
<column name="created_at" type="TINYINT" size="10" required="true"/>
<index name="jobs_queue_index">
<index-column name="queue"/>
</index>
</table>
<table name="JOBS_FAILED" idMethod="native">
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
<parameter name="Collation" value="utf8"/>
</vendor>
<column name="id" type="BIGINT" size="20" required="true" autoIncrement="true" primaryKey="true"/>
<column name="connection" type="LONGVARCHAR" required="true"/>
<column name="queue" type="LONGVARCHAR" required="true"/>
<column name="payload" type="LONGVARCHAR" required="true"/>
<column name="exception" type="LONGVARCHAR" required="true"/>
<column name="failed_at" type="TIMESTAMP" required="true" default="CURRENT_TIMESTAMP"/>
</table>
</database>

View File

@@ -3244,5 +3244,41 @@ CREATE TABLE `APP_DATA_CHANGE_LOG`
KEY `indexExecutedAt`(`EXECUTED_AT`),
KEY `indexSourceId`(`SOURCE_ID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Change log';
#-----------------------------------------------------------------------------
#-- JOBS_PENDING
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `JOBS_PENDING`;
CREATE TABLE `JOBS_PENDING`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`queue` VARCHAR(255) NOT NULL,
`payload` MEDIUMTEXT NOT NULL,
`attempts` TINYINT(3) NOT NULL,
`reserved_at` TINYINT(10) default NULL,
`available_at` TINYINT(10) NOT NULL,
`created_at` TINYINT(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `jobs_queue_index`(`queue`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
#-- JOBS_FAILED
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `JOBS_FAILED`;
CREATE TABLE `JOBS_FAILED`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`connection` MEDIUMTEXT NOT NULL,
`queue` MEDIUMTEXT NOT NULL,
`payload` MEDIUMTEXT NOT NULL,
`exception` MEDIUMTEXT NOT NULL,
`failed_at` DATETIME default 'CURRENT_TIMESTAMP' NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;