aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2024-07-08 18:04:46 +0200
committerJulien Veyssier <julien-nc@posteo.net>2024-07-23 17:12:38 +0200
commitdf086a8c207ec6765a94955f6638fa7aacf4c06a (patch)
tree25679134ebb648dc8edcadfe878587b3868d6746 /core
parent6865be05ec6359240d8dde56d141bbc55a00dfc1 (diff)
downloadnextcloud-server-df086a8c207ec6765a94955f6638fa7aacf4c06a.tar.gz
nextcloud-server-df086a8c207ec6765a94955f6638fa7aacf4c06a.zip
feat(taskprocessing): add start, stop and schedule time to tasks
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'core')
-rw-r--r--core/Migrations/Version30000Date20240708160048.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/core/Migrations/Version30000Date20240708160048.php b/core/Migrations/Version30000Date20240708160048.php
new file mode 100644
index 00000000000..a85eea2c974
--- /dev/null
+++ b/core/Migrations/Version30000Date20240708160048.php
@@ -0,0 +1,56 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OC\Core\Migrations;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+/**
+ *
+ */
+class Version30000Date20240708160048 extends SimpleMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return null|ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ if ($schema->hasTable('taskprocessing_tasks')) {
+ $table = $schema->getTable('taskprocessing_tasks');
+
+ $table->addColumn('scheduled_at', Types::INTEGER, [
+ 'notnull' => false,
+ 'default' => 0,
+ 'unsigned' => true,
+ ]);
+ $table->addColumn('started_at', Types::INTEGER, [
+ 'notnull' => false,
+ 'default' => 0,
+ 'unsigned' => true,
+ ]);
+ $table->addColumn('ended_at', Types::INTEGER, [
+ 'notnull' => false,
+ 'default' => 0,
+ 'unsigned' => true,
+ ]);
+
+ return $schema;
+ }
+
+ return null;
+ }
+}