summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-06-24 10:28:13 +0200
committerGitHub <noreply@github.com>2022-06-24 10:28:13 +0200
commit4722baf970ba514f9495257092f9e200fa7c54e3 (patch)
tree3e91258c679071c7f0dc62c491b9abbbd4b99f62 /core
parente0c6c1582dbea507fe003c63e61ac33b0bdfe3ae (diff)
parent3be1217c046eca725b14348b73d36c7b8d625d44 (diff)
downloadnextcloud-server-4722baf970ba514f9495257092f9e200fa7c54e3.tar.gz
nextcloud-server-4722baf970ba514f9495257092f9e200fa7c54e3.zip
Merge pull request #32863 from nextcloud/feature/add-comments-expire-date
Add comments expire date
Diffstat (limited to 'core')
-rw-r--r--core/Migrations/Version25000Date20220602190540.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/core/Migrations/Version25000Date20220602190540.php b/core/Migrations/Version25000Date20220602190540.php
new file mode 100644
index 00000000000..3a00423570a
--- /dev/null
+++ b/core/Migrations/Version25000Date20220602190540.php
@@ -0,0 +1,57 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2022 Vitor Mattos <vitor@php.rio>
+ *
+ * @author Vitor Mattos <vitor@php.rio>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Core\Migrations;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version25000Date20220602190540 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();
+
+ $comments = $schema->getTable('comments');
+ if (!$comments->hasColumn('expire_date')) {
+ $comments->addColumn('expire_date', Types::DATETIME, [
+ 'notnull' => false,
+ ]);
+ $comments->addIndex(['expire_date'], 'expire_date');
+ return $schema;
+ }
+ return null;
+ }
+}