Code Duplication    Length = 12-20 lines in 3 locations

core/Migrations/Version14000Date20180710092004.php 1 location

@@ 32-48 (lines=17) @@
29
use OCP\Migration\SimpleMigrationStep;
30
use OCP\Migration\IOutput;
31
32
class Version14000Date20180710092004 extends SimpleMigrationStep {
33
34
	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
35
		/** @var ISchemaWrapper $schema */
36
		$schema = $schemaClosure();
37
38
		$table = $schema->getTable('share');
39
40
		if (!$table->hasColumn('password_by_talk')) {
41
			$table->addColumn('password_by_talk', Type::BOOLEAN, [
42
				'default' => 0,
43
			]);
44
		}
45
46
		return $schema;
47
	}
48
}
49

core/Migrations/Version14000Date20180712153140.php 1 location

@@ 32-43 (lines=12) @@
29
 *
30
 * Class Version14000Date20180712153140
31
 */
32
class Version14000Date20180712153140 extends SimpleMigrationStep {
33
	public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
34
35
		/** @var ISchemaWrapper $schema */
36
		$schema = $schemaClosure();
37
38
		$table = $schema->getTable('share');
39
		$table->addColumn('note', 'text', ['notnull' => false]);
40
41
		return $schema;
42
	}
43
}
44

apps/twofactor_backupcodes/lib/Migration/Version1002Date20180821043638.php 1 location

@@ 32-51 (lines=20) @@
29
use OCP\Migration\SimpleMigrationStep;
30
use OCP\Migration\IOutput;
31
32
class Version1002Date20180821043638 extends SimpleMigrationStep {
33
34
	/**
35
	 * @param IOutput $output
36
	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
	 * @param array $options
38
	 *
39
	 * @return ISchemaWrapper
40
	 */
41
	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
42
		/** @var ISchemaWrapper $schema */
43
		$schema = $schemaClosure();
44
		$table = $schema->getTable('twofactor_backupcodes');
45
46
		$table->getColumn('code')->setLength(128);
47
48
		return $schema;
49
	}
50
51
}
52