Browse Source
Merge pull request #47803 from nextcloud/chore/add-migration-attribute
chore(files_sharing): Add migration attribute for `share.reminder_sent` column
pull/47798/merge
Ferdinand Thiessen
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
7 additions and
0 deletions
-
apps/files_sharing/lib/Migration/Version31000Date20240821142813.php
|
|
|
@ -12,9 +12,12 @@ namespace OCA\Files_Sharing\Migration; |
|
|
|
use Closure; |
|
|
|
use OCP\DB\ISchemaWrapper; |
|
|
|
use OCP\DB\Types; |
|
|
|
use OCP\Migration\Attributes\AddColumn; |
|
|
|
use OCP\Migration\Attributes\ColumnType; |
|
|
|
use OCP\Migration\IOutput; |
|
|
|
use OCP\Migration\SimpleMigrationStep; |
|
|
|
|
|
|
|
#[AddColumn(table: 'share', name: 'reminder_sent', type: ColumnType::BOOLEAN)]
|
|
|
|
class Version31000Date20240821142813 extends SimpleMigrationStep { |
|
|
|
|
|
|
|
/** |
|
|
|
@ -26,6 +29,10 @@ class Version31000Date20240821142813 extends SimpleMigrationStep { |
|
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
|
|
$schema = $schemaClosure(); |
|
|
|
$table = $schema->getTable('share'); |
|
|
|
if ($table->hasColumn('reminder_sent')) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
$table->addColumn('reminder_sent', Types::BOOLEAN, [ |
|
|
|
'notnull' => false, |
|
|
|
'default' => false, |
|
|
|
|