Skip to content

Commit

Permalink
only create table if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nag0n committed Jan 18, 2021
1 parent e56284c commit 5e75da0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Job_Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ protected function checkAndIfNecessaryCreateJobQueueTable(): void {
if(!$has_table) {
if($this->isMysqlQueueType()) {
$field_type = $this->options['mysql']['use_compression'] ? 'longblob' : 'longtext';
$this->connection->exec("CREATE TABLE {$table_name} (
$this->connection->exec("CREATE TABLE IF NOT EXISTS {$table_name} (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pipeline` varchar(500) NOT NULL,
`payload` {$field_type} NOT NULL,
Expand All @@ -503,7 +503,7 @@ protected function checkAndIfNecessaryCreateJobQueueTable(): void {
KEY `pipeline_send_dt_is_buried_is_reserved` (`pipeline`(75), `send_dt`, `is_buried`, `is_reserved`)
);");
} else {
$this->connection->exec("CREATE TABLE {$table_name} (
$this->connection->exec("CREATE TABLE IF NOT EXISTS {$table_name} (
'id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
'pipeline' TEXT NOT NULL,
'payload' TEXT NOT NULL,
Expand Down

0 comments on commit 5e75da0

Please sign in to comment.