123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- declare(strict_types=1);
- 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 {
-
- public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
-
- $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;
- }
- }
|