mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Improve compatibility with old DB versions that can't take current_timestamp() as a default value for DATETIME column
This commit is contained in:
parent
84e57ff876
commit
d3b3dc7b0e
2 changed files with 3 additions and 3 deletions
|
|
@ -93,8 +93,8 @@ class DB implements QueueInterface
|
|||
public function addTask(string $handler, ?object $args = null, ?object $options = null): int
|
||||
{
|
||||
$oDB = RFDB::getInstance();
|
||||
$stmt = $oDB->prepare('INSERT INTO task_queue (handler, args, options) VALUES (?, ?, ?)');
|
||||
$result = $stmt->execute([$handler, serialize($args), serialize($options)]);
|
||||
$stmt = $oDB->prepare('INSERT INTO task_queue (handler, args, options, regdate) VALUES (?, ?, ?, ?)');
|
||||
$result = $stmt->execute([$handler, serialize($args), serialize($options), date('Y-m-d H:i:s')]);
|
||||
return $result ? $oDB->getInsertID() : 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
<column name="handler" type="varchar" size="191" notnull="notnull" />
|
||||
<column name="args" type="longtext" notnull="notnull" />
|
||||
<column name="options" type="longtext" notnull="notnull" />
|
||||
<column name="regdate" type="datetime" notnull="notnull" default="current_timestamp()" index="idx_regdate" />
|
||||
<column name="regdate" type="datetime" notnull="notnull" index="idx_regdate" />
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue