lint: modernize old migrations

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-15 13:23:57 -07:00
parent 15be33d94b
commit 1565638405
12 changed files with 52 additions and 45 deletions

View File

@ -31,11 +31,14 @@ use OCP\Migration\SimpleMigrationStep;
class Version000000Date20220812163631 extends SimpleMigrationStep class Version000000Date20220812163631 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*
* @return null|ISchemaWrapper
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/**
* @param \Closure(): ISchemaWrapper $schemaClosure
*/
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
/** @var ISchemaWrapper $schema */ /** @var ISchemaWrapper $schema */
$schema = $schemaClosure(); $schema = $schemaClosure();
@ -46,13 +49,6 @@ class Version000000Date20220812163631 extends SimpleMigrationStep
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
]); ]);
// dropped in Version200000Date20220924015634
// $table->addColumn('uid', 'string', [
// 'notnull' => true,
// 'length' => 64,
// ]);
$table->addColumn('datetaken', Types::DATETIME, [ $table->addColumn('datetaken', Types::DATETIME, [
'notnull' => false, 'notnull' => false,
]); ]);
@ -76,7 +72,13 @@ class Version000000Date20220812163631 extends SimpleMigrationStep
$table->setPrimaryKey(['id']); $table->setPrimaryKey(['id']);
// All these indices are dropped in Version200000Date20220924015634 // All these are dropped in Version200000Date20220924015634
//
// $table->addColumn('uid', 'string', [
// 'notnull' => true,
// 'length' => 64,
// ]);
//
// $table->addIndex(['uid'], 'memories_uid_index'); // $table->addIndex(['uid'], 'memories_uid_index');
// $table->addIndex(['uid', 'dayid'], 'memories_ud_index'); // $table->addIndex(['uid', 'dayid'], 'memories_ud_index');
// $table->addUniqueIndex(['uid', 'fileid'], 'memories_day_uf_ui'); // $table->addUniqueIndex(['uid', 'fileid'], 'memories_day_uf_ui');
@ -84,4 +86,9 @@ class Version000000Date20220812163631 extends SimpleMigrationStep
return $schema; return $schema;
} }
/**
* @param \Closure(): ISchemaWrapper $schemaClosure
*/
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -42,7 +42,7 @@ class Version200000Date20220924015634 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void
{ {
@ -58,7 +58,7 @@ class Version200000Date20220924015634 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -102,7 +102,7 @@ class Version200000Date20220924015634 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -34,12 +34,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version400000Date20221015121115 extends SimpleMigrationStep class Version400000Date20221015121115 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -70,7 +70,7 @@ class Version400000Date20221015121115 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -33,12 +33,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version400307Date20221025002524 extends SimpleMigrationStep class Version400307Date20221025002524 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -56,7 +56,7 @@ class Version400307Date20221025002524 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -33,12 +33,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version400308Date20221026151748 extends SimpleMigrationStep class Version400308Date20221026151748 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -48,7 +48,7 @@ class Version400308Date20221026151748 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -42,12 +42,12 @@ class Version400503Date20221101033144 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -76,7 +76,7 @@ class Version400503Date20221101033144 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void
{ {

View File

@ -33,12 +33,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version400604Date20221107205439 extends SimpleMigrationStep class Version400604Date20221107205439 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -59,7 +59,7 @@ class Version400604Date20221107205439 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -34,12 +34,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version400700Date20221110030909 extends SimpleMigrationStep class Version400700Date20221110030909 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -59,7 +59,7 @@ class Version400700Date20221110030909 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -34,12 +34,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version400800Date20221122105007 extends SimpleMigrationStep class Version400800Date20221122105007 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -90,7 +90,7 @@ class Version400800Date20221122105007 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -34,12 +34,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version401000Date20230118043813 extends SimpleMigrationStep class Version401000Date20230118043813 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -59,7 +59,7 @@ class Version401000Date20230118043813 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -34,12 +34,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version401100Date20230206002744 extends SimpleMigrationStep class Version401100Date20230206002744 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -91,7 +91,7 @@ class Version401100Date20230206002744 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }

View File

@ -34,12 +34,12 @@ use OCP\Migration\SimpleMigrationStep;
class Version401100Date20230208181533 extends SimpleMigrationStep class Version401100Date20230208181533 extends SimpleMigrationStep
{ {
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options): ?ISchemaWrapper
{ {
@ -123,7 +123,7 @@ class Version401100Date20230208181533 extends SimpleMigrationStep
} }
/** /**
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure(): ISchemaWrapper $schemaClosure
*/ */
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {} public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {}
} }