Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions apps/dav/lib/Migration/Version1025Date20240308063933.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

class Version1025Date20240308063933 extends SimpleMigrationStep {

public function __construct(
private IAppConfig $appConfig,
private IDBConnection $db,
private readonly IAppConfig $appConfig,
private readonly IDBConnection $db,
) {
}

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand All @@ -50,6 +46,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
return $schema;
}

#[Override]
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {
// The threshold is higher than the default of \OCA\DAV\BackgroundJob\PruneOutdatedSyncTokensJob
// but small enough to fit into a cluster transaction size.
Expand Down
9 changes: 3 additions & 6 deletions apps/dav/lib/Migration/Version1027Date20230504122946.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

use Closure;
use OCA\DAV\CardDAV\SyncService;
use OCP\DB\ISchemaWrapper;
use OCP\IConfig;
use OCP\IUserManager;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;
use Psr\Log\LoggerInterface;
use Throwable;

Expand All @@ -27,11 +27,8 @@ public function __construct(
private IConfig $config,
) {
}
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/

#[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
if ($this->userManager->countSeenUsers() > 100 || $this->userManager->countUsersTotal(100) >= 100) {
$this->config->setAppValue('dav', 'needs_system_address_book_sync', 'yes');
Expand Down
10 changes: 4 additions & 6 deletions apps/dav/lib/Migration/Version1029Date20231004091403.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
use OCP\Migration\Attributes\CreateTable;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

#[CreateTable(table: 'dav_absence')]
class Version1029Date20231004091403 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
11 changes: 4 additions & 7 deletions apps/dav/lib/Migration/Version1030Date20240205103243.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\Attributes\DropIndex;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

#[DropIndex(table: 'cards')]
class Version1030Date20240205103243 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
8 changes: 2 additions & 6 deletions apps/dav/lib/Migration/Version1034Date20250605132605.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@
use OCP\Migration\Attributes\CreateTable;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

#[AddColumn(table: 'dav_shares', name: 'token', type: ColumnType::STRING)]
#[CreateTable(table: 'calendars_federated', columns: ['id', 'display_name', 'color', 'uri', 'principaluri', 'remote_Url', 'token', 'sync_token', 'last_sync', 'shared_by', 'shared_by_display_name', 'components', 'permissions'], description: 'Supporting Federated Calender')]
class Version1034Date20250605132605 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
6 changes: 0 additions & 6 deletions apps/dav/lib/Migration/Version1034Date20250813093701.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace OCA\DAV\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\Migration\Attributes\DataCleansing;
Expand All @@ -25,11 +24,6 @@ public function __construct(
) {
}

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/
#[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$qb = $this->db->getQueryBuilder();
Expand Down
3 changes: 0 additions & 3 deletions apps/dav/lib/Migration/Version1036Date20251202000000.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#[ModifyColumn(table: 'calendar_reminders', name: 'uid', type: ColumnType::STRING, description: 'Increase uid length to 512 characters')]
#[ModifyColumn(table: 'calendar_invitations', name: 'uid', type: ColumnType::STRING, description: 'Increase uid length to 512 characters')]
class Version1036Date20251202000000 extends SimpleMigrationStep {
/**
* @param Closure(): ISchemaWrapper $schemaClosure
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
Expand Down
24 changes: 12 additions & 12 deletions apps/files/lib/Migration/Version2003Date20241021095629.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@

use Closure;
use OCA\Files\Service\ChunkedUploadConfig;
use OCP\DB\ISchemaWrapper;
use OCP\IConfig;
use OCP\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use OCP\Server;
use Override;

class Version2003Date20241021095629 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
*/
public function __construct(
public readonly IAppConfig $appConfig,
) {
}

#[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$maxChunkSize = Server::get(IConfig::class)->getAppValue('files', 'max_chunk_size');
if ($maxChunkSize === '') {
$maxChunkSize = $this->appConfig->getValueInt('files', 'max_chunk_size');
if ($maxChunkSize === 0) {
// Skip if no value was configured before
return;
}

ChunkedUploadConfig::setMaxChunkSize((int)$maxChunkSize);
Server::get(IConfig::class)->deleteAppValue('files', 'max_chunk_size');
ChunkedUploadConfig::setMaxChunkSize($maxChunkSize);
$this->appConfig->deleteKey('files', 'max_chunk_size');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,20 @@

use Closure;
use OCA\Files_External\Service\GlobalStoragesService;
use OCP\DB\ISchemaWrapper;
use OCP\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

/**
* Check for any external storage overwriting the home folder
*/
class Version1025Date20250228162604 extends SimpleMigrationStep {
public function __construct(
private GlobalStoragesService $globalStoragesServices,
private IAppConfig $appConfig,
) {
}

/**
* @param Closure(): ISchemaWrapper $schemaClosure
*/
#[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$this->globalStoragesServices->updateOverwriteHomeFolders();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@
use OCP\Migration\Attributes\ColumnType;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

#[AddColumn(table: 'share', name: 'reminder_sent', type: ColumnType::BOOLEAN)]
class Version31000Date20240821142813 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$table = $schema->getTable('share');
if ($table->hasColumn('reminder_sent')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
use OCP\Migration\Attributes\ColumnType;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

#[AddColumn(table: 'files_trash', name: 'deleted_by', type: ColumnType::STRING)]
class Version1020Date20240403003535 extends SimpleMigrationStep {

/**
* @param Closure(): ISchemaWrapper $schemaClosure
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

class Version1000Date20240527153425 extends SimpleMigrationStep {
/**
* @param Closure(): ISchemaWrapper $schemaClosure
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

class Version1001Date20240716184935 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

if ($schema->hasTable(WebhookListenerMapper::TABLE_NAME)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

class Version1500Date20251007130000 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
$schemaHasChanged = false;
Expand Down
7 changes: 0 additions & 7 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1318,12 +1318,6 @@
<code><![CDATA[$i]]></code>
</UndefinedInterfaceMethod>
</file>
<file src="apps/files/lib/Migration/Version2003Date20241021095629.php">
<DeprecatedMethod>
<code><![CDATA[deleteAppValue]]></code>
<code><![CDATA[getAppValue]]></code>
</DeprecatedMethod>
</file>
<file src="apps/files/lib/Service/OwnershipTransferService.php">
<DeprecatedClass>
<code><![CDATA[\OC_Util::setupFS($destinationUser->getUID())]]></code>
Expand Down Expand Up @@ -3535,7 +3529,6 @@
<file src="lib/private/Files/Cache/Wrapper/CacheWrapper.php">
<LessSpecificImplementedReturnType>
<code><![CDATA[array]]></code>
<code><![CDATA[array]]></code>
</LessSpecificImplementedReturnType>
</file>
<file src="lib/private/Files/Config/MountProviderCollection.php">
Expand Down
5 changes: 4 additions & 1 deletion core/Command/Db/ExpectedSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
use OC\DB\MigrationService;
use OC\DB\SchemaWrapper;
use OC\Migration\NullOutput;
use Override;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class ExpectedSchema extends Base {
public function __construct(
protected Connection $connection,
protected readonly Connection $connection,
) {
parent::__construct();
}

#[Override]
protected function configure(): void {
$this
->setName('db:schema:expected')
Expand All @@ -36,6 +38,7 @@ protected function configure(): void {
parent::configure();
}

#[Override]
protected function execute(InputInterface $input, OutputInterface $output): int {
$schema = new Schema();
$onlyTable = $input->getArgument('table');
Expand Down
8 changes: 2 additions & 6 deletions core/Migrations/Version29000Date20231213104850.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

class Version29000Date20231213104850 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
8 changes: 2 additions & 6 deletions core/Migrations/Version29000Date20240131122720.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
use Override;

/**
*
*/
class Version29000Date20240131122720 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
Expand Down
Loading
Loading