@@ -30,43 +30,43 @@ |
||
30 | 30 | use OCP\Migration\SimpleMigrationStep; |
31 | 31 | |
32 | 32 | class Version1002Date20170607104347 extends SimpleMigrationStep { |
33 | - /** |
|
34 | - * @param IOutput $output |
|
35 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
36 | - * @param array $options |
|
37 | - * @return null|ISchemaWrapper |
|
38 | - * @since 13.0.0 |
|
39 | - */ |
|
40 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
41 | - /** @var ISchemaWrapper $schema */ |
|
42 | - $schema = $schemaClosure(); |
|
33 | + /** |
|
34 | + * @param IOutput $output |
|
35 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
36 | + * @param array $options |
|
37 | + * @return null|ISchemaWrapper |
|
38 | + * @since 13.0.0 |
|
39 | + */ |
|
40 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
41 | + /** @var ISchemaWrapper $schema */ |
|
42 | + $schema = $schemaClosure(); |
|
43 | 43 | |
44 | - if (!$schema->hasTable('twofactor_backupcodes')) { |
|
45 | - $table = $schema->createTable('twofactor_backupcodes'); |
|
44 | + if (!$schema->hasTable('twofactor_backupcodes')) { |
|
45 | + $table = $schema->createTable('twofactor_backupcodes'); |
|
46 | 46 | |
47 | - $table->addColumn('id', Types::INTEGER, [ |
|
48 | - 'autoincrement' => true, |
|
49 | - 'notnull' => true, |
|
50 | - 'length' => 20, |
|
51 | - ]); |
|
52 | - $table->addColumn('user_id', Types::STRING, [ |
|
53 | - 'notnull' => true, |
|
54 | - 'length' => 64, |
|
55 | - ]); |
|
56 | - $table->addColumn('code', Types::STRING, [ |
|
57 | - 'notnull' => true, |
|
58 | - 'length' => 64, |
|
59 | - ]); |
|
60 | - $table->addColumn('used', Types::INTEGER, [ |
|
61 | - 'notnull' => true, |
|
62 | - 'length' => 1, |
|
63 | - 'default' => 0, |
|
64 | - ]); |
|
47 | + $table->addColumn('id', Types::INTEGER, [ |
|
48 | + 'autoincrement' => true, |
|
49 | + 'notnull' => true, |
|
50 | + 'length' => 20, |
|
51 | + ]); |
|
52 | + $table->addColumn('user_id', Types::STRING, [ |
|
53 | + 'notnull' => true, |
|
54 | + 'length' => 64, |
|
55 | + ]); |
|
56 | + $table->addColumn('code', Types::STRING, [ |
|
57 | + 'notnull' => true, |
|
58 | + 'length' => 64, |
|
59 | + ]); |
|
60 | + $table->addColumn('used', Types::INTEGER, [ |
|
61 | + 'notnull' => true, |
|
62 | + 'length' => 1, |
|
63 | + 'default' => 0, |
|
64 | + ]); |
|
65 | 65 | |
66 | - $table->setPrimaryKey(['id']); |
|
67 | - $table->addIndex(['user_id'], 'twofactor_backupcodes_uid'); |
|
68 | - } |
|
66 | + $table->setPrimaryKey(['id']); |
|
67 | + $table->addIndex(['user_id'], 'twofactor_backupcodes_uid'); |
|
68 | + } |
|
69 | 69 | |
70 | - return $schema; |
|
71 | - } |
|
70 | + return $schema; |
|
71 | + } |
|
72 | 72 | } |
@@ -32,27 +32,27 @@ |
||
32 | 32 | |
33 | 33 | class Version1002Date20170919123342 extends SimpleMigrationStep { |
34 | 34 | |
35 | - /** |
|
36 | - * @param IOutput $output |
|
37 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | - * @param array $options |
|
39 | - * @return null|ISchemaWrapper |
|
40 | - * @since 13.0.0 |
|
41 | - */ |
|
42 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
43 | - /** @var ISchemaWrapper $schema */ |
|
44 | - $schema = $schemaClosure(); |
|
35 | + /** |
|
36 | + * @param IOutput $output |
|
37 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
38 | + * @param array $options |
|
39 | + * @return null|ISchemaWrapper |
|
40 | + * @since 13.0.0 |
|
41 | + */ |
|
42 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
43 | + /** @var ISchemaWrapper $schema */ |
|
44 | + $schema = $schemaClosure(); |
|
45 | 45 | |
46 | - $table = $schema->getTable('twofactor_backupcodes'); |
|
47 | - $column = $table->getColumn('user_id'); |
|
48 | - $column->setDefault(''); |
|
46 | + $table = $schema->getTable('twofactor_backupcodes'); |
|
47 | + $column = $table->getColumn('user_id'); |
|
48 | + $column->setDefault(''); |
|
49 | 49 | |
50 | - $column = $table->getColumn('used'); |
|
51 | - if ($column->getType()->getName() !== Types::SMALLINT) { |
|
52 | - $column->setType(Type::getType(Types::SMALLINT)); |
|
53 | - $column->setOptions(['length' => 6]); |
|
54 | - } |
|
50 | + $column = $table->getColumn('used'); |
|
51 | + if ($column->getType()->getName() !== Types::SMALLINT) { |
|
52 | + $column->setType(Type::getType(Types::SMALLINT)); |
|
53 | + $column->setOptions(['length' => 6]); |
|
54 | + } |
|
55 | 55 | |
56 | - return $schema; |
|
57 | - } |
|
56 | + return $schema; |
|
57 | + } |
|
58 | 58 | } |
@@ -37,42 +37,42 @@ |
||
37 | 37 | * Auto-generated migration step: Please modify to your needs! |
38 | 38 | */ |
39 | 39 | class Version1011Date20190806104428 extends SimpleMigrationStep { |
40 | - /** |
|
41 | - * @param IOutput $output |
|
42 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
43 | - * @param array $options |
|
44 | - * @return null|ISchemaWrapper |
|
45 | - */ |
|
46 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
47 | - /** @var ISchemaWrapper $schema */ |
|
48 | - $schema = $schemaClosure(); |
|
40 | + /** |
|
41 | + * @param IOutput $output |
|
42 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
43 | + * @param array $options |
|
44 | + * @return null|ISchemaWrapper |
|
45 | + */ |
|
46 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
47 | + /** @var ISchemaWrapper $schema */ |
|
48 | + $schema = $schemaClosure(); |
|
49 | 49 | |
50 | - $table = $schema->createTable('dav_cal_proxy'); |
|
51 | - $table->addColumn('id', Types::BIGINT, [ |
|
52 | - 'autoincrement' => true, |
|
53 | - 'notnull' => true, |
|
54 | - 'length' => 11, |
|
55 | - 'unsigned' => true, |
|
56 | - ]); |
|
57 | - $table->addColumn('owner_id', Types::STRING, [ |
|
58 | - 'notnull' => true, |
|
59 | - 'length' => 64, |
|
60 | - ]); |
|
61 | - $table->addColumn('proxy_id', Types::STRING, [ |
|
62 | - 'notnull' => true, |
|
63 | - 'length' => 64, |
|
64 | - ]); |
|
65 | - $table->addColumn('permissions', Types::INTEGER, [ |
|
66 | - 'notnull' => false, |
|
67 | - 'length' => 4, |
|
68 | - 'unsigned' => true, |
|
69 | - ]); |
|
50 | + $table = $schema->createTable('dav_cal_proxy'); |
|
51 | + $table->addColumn('id', Types::BIGINT, [ |
|
52 | + 'autoincrement' => true, |
|
53 | + 'notnull' => true, |
|
54 | + 'length' => 11, |
|
55 | + 'unsigned' => true, |
|
56 | + ]); |
|
57 | + $table->addColumn('owner_id', Types::STRING, [ |
|
58 | + 'notnull' => true, |
|
59 | + 'length' => 64, |
|
60 | + ]); |
|
61 | + $table->addColumn('proxy_id', Types::STRING, [ |
|
62 | + 'notnull' => true, |
|
63 | + 'length' => 64, |
|
64 | + ]); |
|
65 | + $table->addColumn('permissions', Types::INTEGER, [ |
|
66 | + 'notnull' => false, |
|
67 | + 'length' => 4, |
|
68 | + 'unsigned' => true, |
|
69 | + ]); |
|
70 | 70 | |
71 | - $table->setPrimaryKey(['id']); |
|
72 | - $table->addUniqueIndex(['owner_id', 'proxy_id', 'permissions'], 'dav_cal_proxy_uidx'); |
|
73 | - $table->addIndex(['owner_id'], 'dav_cal_proxy_ioid'); |
|
74 | - $table->addIndex(['proxy_id'], 'dav_cal_proxy_ipid'); |
|
71 | + $table->setPrimaryKey(['id']); |
|
72 | + $table->addUniqueIndex(['owner_id', 'proxy_id', 'permissions'], 'dav_cal_proxy_uidx'); |
|
73 | + $table->addIndex(['owner_id'], 'dav_cal_proxy_ioid'); |
|
74 | + $table->addIndex(['proxy_id'], 'dav_cal_proxy_ipid'); |
|
75 | 75 | |
76 | - return $schema; |
|
77 | - } |
|
76 | + return $schema; |
|
77 | + } |
|
78 | 78 | } |
@@ -35,76 +35,76 @@ |
||
35 | 35 | |
36 | 36 | class Version1006Date20180628111625 extends SimpleMigrationStep { |
37 | 37 | |
38 | - /** |
|
39 | - * @param IOutput $output |
|
40 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | - * @param array $options |
|
42 | - * @return null|ISchemaWrapper |
|
43 | - */ |
|
44 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
45 | - /** @var ISchemaWrapper $schema */ |
|
46 | - $schema = $schemaClosure(); |
|
47 | - |
|
48 | - if ($schema->hasTable('calendarchanges')) { |
|
49 | - $calendarChangesTable = $schema->getTable('calendarchanges'); |
|
50 | - $calendarChangesTable->addColumn('calendartype', Types::INTEGER, [ |
|
51 | - 'notnull' => true, |
|
52 | - 'default' => 0, |
|
53 | - ]); |
|
54 | - |
|
55 | - if ($calendarChangesTable->hasIndex('calendarid_synctoken')) { |
|
56 | - $calendarChangesTable->dropIndex('calendarid_synctoken'); |
|
57 | - } |
|
58 | - $calendarChangesTable->addIndex(['calendarid', 'calendartype', 'synctoken'], 'calid_type_synctoken'); |
|
59 | - } |
|
60 | - |
|
61 | - if ($schema->hasTable('calendarobjects')) { |
|
62 | - $calendarObjectsTable = $schema->getTable('calendarobjects'); |
|
63 | - $calendarObjectsTable->addColumn('calendartype', Types::INTEGER, [ |
|
64 | - 'notnull' => true, |
|
65 | - 'default' => 0, |
|
66 | - ]); |
|
67 | - |
|
68 | - if ($calendarObjectsTable->hasIndex('calobjects_index')) { |
|
69 | - $calendarObjectsTable->dropIndex('calobjects_index'); |
|
70 | - } |
|
71 | - $calendarObjectsTable->addUniqueIndex(['calendarid', 'calendartype', 'uri'], 'calobjects_index'); |
|
72 | - } |
|
73 | - |
|
74 | - if ($schema->hasTable('calendarobjects_props')) { |
|
75 | - $calendarObjectsPropsTable = $schema->getTable('calendarobjects_props'); |
|
76 | - $calendarObjectsPropsTable->addColumn('calendartype', Types::INTEGER, [ |
|
77 | - 'notnull' => true, |
|
78 | - 'default' => 0, |
|
79 | - ]); |
|
80 | - |
|
81 | - |
|
82 | - if ($calendarObjectsPropsTable->hasIndex('calendarobject_index')) { |
|
83 | - $calendarObjectsPropsTable->dropIndex('calendarobject_index'); |
|
84 | - } |
|
85 | - if ($calendarObjectsPropsTable->hasIndex('calendarobject_name_index')) { |
|
86 | - $calendarObjectsPropsTable->dropIndex('calendarobject_name_index'); |
|
87 | - } |
|
88 | - if ($calendarObjectsPropsTable->hasIndex('calendarobject_value_index')) { |
|
89 | - $calendarObjectsPropsTable->dropIndex('calendarobject_value_index'); |
|
90 | - } |
|
91 | - |
|
92 | - $calendarObjectsPropsTable->addIndex(['objectid', 'calendartype'], 'calendarobject_index'); |
|
93 | - $calendarObjectsPropsTable->addIndex(['name', 'calendartype'], 'calendarobject_name_index'); |
|
94 | - $calendarObjectsPropsTable->addIndex(['value', 'calendartype'], 'calendarobject_value_index'); |
|
95 | - $calendarObjectsPropsTable->addIndex(['calendarid', 'calendartype'], 'calendarobject_calid_index'); |
|
96 | - } |
|
97 | - |
|
98 | - if ($schema->hasTable('calendarsubscriptions')) { |
|
99 | - $calendarSubscriptionsTable = $schema->getTable('calendarsubscriptions'); |
|
100 | - $calendarSubscriptionsTable->addColumn('synctoken', 'integer', [ |
|
101 | - 'notnull' => true, |
|
102 | - 'default' => 1, |
|
103 | - 'length' => 10, |
|
104 | - 'unsigned' => true, |
|
105 | - ]); |
|
106 | - } |
|
107 | - |
|
108 | - return $schema; |
|
109 | - } |
|
38 | + /** |
|
39 | + * @param IOutput $output |
|
40 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | + * @param array $options |
|
42 | + * @return null|ISchemaWrapper |
|
43 | + */ |
|
44 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
45 | + /** @var ISchemaWrapper $schema */ |
|
46 | + $schema = $schemaClosure(); |
|
47 | + |
|
48 | + if ($schema->hasTable('calendarchanges')) { |
|
49 | + $calendarChangesTable = $schema->getTable('calendarchanges'); |
|
50 | + $calendarChangesTable->addColumn('calendartype', Types::INTEGER, [ |
|
51 | + 'notnull' => true, |
|
52 | + 'default' => 0, |
|
53 | + ]); |
|
54 | + |
|
55 | + if ($calendarChangesTable->hasIndex('calendarid_synctoken')) { |
|
56 | + $calendarChangesTable->dropIndex('calendarid_synctoken'); |
|
57 | + } |
|
58 | + $calendarChangesTable->addIndex(['calendarid', 'calendartype', 'synctoken'], 'calid_type_synctoken'); |
|
59 | + } |
|
60 | + |
|
61 | + if ($schema->hasTable('calendarobjects')) { |
|
62 | + $calendarObjectsTable = $schema->getTable('calendarobjects'); |
|
63 | + $calendarObjectsTable->addColumn('calendartype', Types::INTEGER, [ |
|
64 | + 'notnull' => true, |
|
65 | + 'default' => 0, |
|
66 | + ]); |
|
67 | + |
|
68 | + if ($calendarObjectsTable->hasIndex('calobjects_index')) { |
|
69 | + $calendarObjectsTable->dropIndex('calobjects_index'); |
|
70 | + } |
|
71 | + $calendarObjectsTable->addUniqueIndex(['calendarid', 'calendartype', 'uri'], 'calobjects_index'); |
|
72 | + } |
|
73 | + |
|
74 | + if ($schema->hasTable('calendarobjects_props')) { |
|
75 | + $calendarObjectsPropsTable = $schema->getTable('calendarobjects_props'); |
|
76 | + $calendarObjectsPropsTable->addColumn('calendartype', Types::INTEGER, [ |
|
77 | + 'notnull' => true, |
|
78 | + 'default' => 0, |
|
79 | + ]); |
|
80 | + |
|
81 | + |
|
82 | + if ($calendarObjectsPropsTable->hasIndex('calendarobject_index')) { |
|
83 | + $calendarObjectsPropsTable->dropIndex('calendarobject_index'); |
|
84 | + } |
|
85 | + if ($calendarObjectsPropsTable->hasIndex('calendarobject_name_index')) { |
|
86 | + $calendarObjectsPropsTable->dropIndex('calendarobject_name_index'); |
|
87 | + } |
|
88 | + if ($calendarObjectsPropsTable->hasIndex('calendarobject_value_index')) { |
|
89 | + $calendarObjectsPropsTable->dropIndex('calendarobject_value_index'); |
|
90 | + } |
|
91 | + |
|
92 | + $calendarObjectsPropsTable->addIndex(['objectid', 'calendartype'], 'calendarobject_index'); |
|
93 | + $calendarObjectsPropsTable->addIndex(['name', 'calendartype'], 'calendarobject_name_index'); |
|
94 | + $calendarObjectsPropsTable->addIndex(['value', 'calendartype'], 'calendarobject_value_index'); |
|
95 | + $calendarObjectsPropsTable->addIndex(['calendarid', 'calendartype'], 'calendarobject_calid_index'); |
|
96 | + } |
|
97 | + |
|
98 | + if ($schema->hasTable('calendarsubscriptions')) { |
|
99 | + $calendarSubscriptionsTable = $schema->getTable('calendarsubscriptions'); |
|
100 | + $calendarSubscriptionsTable->addColumn('synctoken', 'integer', [ |
|
101 | + 'notnull' => true, |
|
102 | + 'default' => 1, |
|
103 | + 'length' => 10, |
|
104 | + 'unsigned' => true, |
|
105 | + ]); |
|
106 | + } |
|
107 | + |
|
108 | + return $schema; |
|
109 | + } |
|
110 | 110 | } |
@@ -35,45 +35,45 @@ |
||
35 | 35 | |
36 | 36 | class Version1008Date20181105110300 extends SimpleMigrationStep { |
37 | 37 | |
38 | - /** @var IDBConnection */ |
|
39 | - private $connection; |
|
38 | + /** @var IDBConnection */ |
|
39 | + private $connection; |
|
40 | 40 | |
41 | - /** |
|
42 | - * Version1008Date20181105110300 constructor. |
|
43 | - * |
|
44 | - * @param IDBConnection $connection |
|
45 | - */ |
|
46 | - public function __construct(IDBConnection $connection) { |
|
47 | - $this->connection = $connection; |
|
48 | - } |
|
41 | + /** |
|
42 | + * Version1008Date20181105110300 constructor. |
|
43 | + * |
|
44 | + * @param IDBConnection $connection |
|
45 | + */ |
|
46 | + public function __construct(IDBConnection $connection) { |
|
47 | + $this->connection = $connection; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * @param IOutput $output |
|
52 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
53 | - * @param array $options |
|
54 | - * @return null|ISchemaWrapper |
|
55 | - */ |
|
56 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
57 | - /** @var ISchemaWrapper $schema */ |
|
58 | - $schema = $schemaClosure(); |
|
59 | - $table = $schema->getTable('calendarsubscriptions'); |
|
60 | - $table->addColumn('source', Types::TEXT, [ |
|
61 | - 'notnull' => false, |
|
62 | - 'length' => null, |
|
63 | - ]); |
|
50 | + /** |
|
51 | + * @param IOutput $output |
|
52 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
53 | + * @param array $options |
|
54 | + * @return null|ISchemaWrapper |
|
55 | + */ |
|
56 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
57 | + /** @var ISchemaWrapper $schema */ |
|
58 | + $schema = $schemaClosure(); |
|
59 | + $table = $schema->getTable('calendarsubscriptions'); |
|
60 | + $table->addColumn('source', Types::TEXT, [ |
|
61 | + 'notnull' => false, |
|
62 | + 'length' => null, |
|
63 | + ]); |
|
64 | 64 | |
65 | - return $schema; |
|
66 | - } |
|
65 | + return $schema; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @param IOutput $output |
|
70 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
71 | - * @param array $options |
|
72 | - */ |
|
73 | - public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { |
|
74 | - $qb = $this->connection->getQueryBuilder(); |
|
75 | - $qb->update('calendarsubscriptions') |
|
76 | - ->set('source', 'source_copy') |
|
77 | - ->execute(); |
|
78 | - } |
|
68 | + /** |
|
69 | + * @param IOutput $output |
|
70 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
71 | + * @param array $options |
|
72 | + */ |
|
73 | + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { |
|
74 | + $qb = $this->connection->getQueryBuilder(); |
|
75 | + $qb->update('calendarsubscriptions') |
|
76 | + ->set('source', 'source_copy') |
|
77 | + ->execute(); |
|
78 | + } |
|
79 | 79 | } |
@@ -34,22 +34,22 @@ |
||
34 | 34 | |
35 | 35 | class Version1008Date20181030113700 extends SimpleMigrationStep { |
36 | 36 | |
37 | - /** |
|
38 | - * @param IOutput $output |
|
39 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
40 | - * @param array $options |
|
41 | - * @return null|ISchemaWrapper |
|
42 | - */ |
|
43 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
44 | - /** @var ISchemaWrapper $schema */ |
|
45 | - $schema = $schemaClosure(); |
|
37 | + /** |
|
38 | + * @param IOutput $output |
|
39 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
40 | + * @param array $options |
|
41 | + * @return null|ISchemaWrapper |
|
42 | + */ |
|
43 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
44 | + /** @var ISchemaWrapper $schema */ |
|
45 | + $schema = $schemaClosure(); |
|
46 | 46 | |
47 | - $table = $schema->getTable('cards'); |
|
48 | - $table->addColumn('uid', Types::STRING, [ |
|
49 | - 'notnull' => false, |
|
50 | - 'length' => 255 |
|
51 | - ]); |
|
47 | + $table = $schema->getTable('cards'); |
|
48 | + $table->addColumn('uid', Types::STRING, [ |
|
49 | + 'notnull' => false, |
|
50 | + 'length' => 255 |
|
51 | + ]); |
|
52 | 52 | |
53 | - return $schema; |
|
54 | - } |
|
53 | + return $schema; |
|
54 | + } |
|
55 | 55 | } |
@@ -33,50 +33,50 @@ |
||
33 | 33 | |
34 | 34 | class Version1005Date20180413093149 extends SimpleMigrationStep { |
35 | 35 | |
36 | - /** |
|
37 | - * @param IOutput $output |
|
38 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 | - * @param array $options |
|
40 | - * @return null|ISchemaWrapper |
|
41 | - */ |
|
42 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
36 | + /** |
|
37 | + * @param IOutput $output |
|
38 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 | + * @param array $options |
|
40 | + * @return null|ISchemaWrapper |
|
41 | + */ |
|
42 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
43 | 43 | |
44 | - /** @var ISchemaWrapper $schema */ |
|
45 | - $schema = $schemaClosure(); |
|
44 | + /** @var ISchemaWrapper $schema */ |
|
45 | + $schema = $schemaClosure(); |
|
46 | 46 | |
47 | - if (!$schema->hasTable('directlink')) { |
|
48 | - $table = $schema->createTable('directlink'); |
|
47 | + if (!$schema->hasTable('directlink')) { |
|
48 | + $table = $schema->createTable('directlink'); |
|
49 | 49 | |
50 | - $table->addColumn('id',Types::BIGINT, [ |
|
51 | - 'autoincrement' => true, |
|
52 | - 'notnull' => true, |
|
53 | - 'length' => 11, |
|
54 | - 'unsigned' => true, |
|
55 | - ]); |
|
56 | - $table->addColumn('user_id', Types::STRING, [ |
|
57 | - 'notnull' => false, |
|
58 | - 'length' => 64, |
|
59 | - ]); |
|
60 | - $table->addColumn('file_id', Types::BIGINT, [ |
|
61 | - 'notnull' => true, |
|
62 | - 'length' => 11, |
|
63 | - 'unsigned' => true, |
|
64 | - ]); |
|
65 | - $table->addColumn('token', Types::STRING, [ |
|
66 | - 'notnull' => false, |
|
67 | - 'length' => 60, |
|
68 | - ]); |
|
69 | - $table->addColumn('expiration', Types::BIGINT, [ |
|
70 | - 'notnull' => true, |
|
71 | - 'length' => 11, |
|
72 | - 'unsigned' => true, |
|
73 | - ]); |
|
50 | + $table->addColumn('id',Types::BIGINT, [ |
|
51 | + 'autoincrement' => true, |
|
52 | + 'notnull' => true, |
|
53 | + 'length' => 11, |
|
54 | + 'unsigned' => true, |
|
55 | + ]); |
|
56 | + $table->addColumn('user_id', Types::STRING, [ |
|
57 | + 'notnull' => false, |
|
58 | + 'length' => 64, |
|
59 | + ]); |
|
60 | + $table->addColumn('file_id', Types::BIGINT, [ |
|
61 | + 'notnull' => true, |
|
62 | + 'length' => 11, |
|
63 | + 'unsigned' => true, |
|
64 | + ]); |
|
65 | + $table->addColumn('token', Types::STRING, [ |
|
66 | + 'notnull' => false, |
|
67 | + 'length' => 60, |
|
68 | + ]); |
|
69 | + $table->addColumn('expiration', Types::BIGINT, [ |
|
70 | + 'notnull' => true, |
|
71 | + 'length' => 11, |
|
72 | + 'unsigned' => true, |
|
73 | + ]); |
|
74 | 74 | |
75 | - $table->setPrimaryKey(['id'], 'directlink_id_idx'); |
|
76 | - $table->addIndex(['token'], 'directlink_token_idx'); |
|
77 | - $table->addIndex(['expiration'], 'directlink_expiration_idx'); |
|
75 | + $table->setPrimaryKey(['id'], 'directlink_id_idx'); |
|
76 | + $table->addIndex(['token'], 'directlink_token_idx'); |
|
77 | + $table->addIndex(['expiration'], 'directlink_expiration_idx'); |
|
78 | 78 | |
79 | - return $schema; |
|
80 | - } |
|
81 | - } |
|
79 | + return $schema; |
|
80 | + } |
|
81 | + } |
|
82 | 82 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | if (!$schema->hasTable('directlink')) { |
48 | 48 | $table = $schema->createTable('directlink'); |
49 | 49 | |
50 | - $table->addColumn('id',Types::BIGINT, [ |
|
50 | + $table->addColumn('id', Types::BIGINT, [ |
|
51 | 51 | 'autoincrement' => true, |
52 | 52 | 'notnull' => true, |
53 | 53 | 'length' => 11, |
@@ -35,61 +35,61 @@ |
||
35 | 35 | */ |
36 | 36 | class Version1006Date20180619154313 extends SimpleMigrationStep { |
37 | 37 | |
38 | - /** |
|
39 | - * @param IOutput $output |
|
40 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | - * @param array $options |
|
42 | - * @return null|ISchemaWrapper |
|
43 | - * @since 13.0.0 |
|
44 | - */ |
|
45 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
46 | - /** @var ISchemaWrapper $schema */ |
|
47 | - $schema = $schemaClosure(); |
|
38 | + /** |
|
39 | + * @param IOutput $output |
|
40 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
41 | + * @param array $options |
|
42 | + * @return null|ISchemaWrapper |
|
43 | + * @since 13.0.0 |
|
44 | + */ |
|
45 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
46 | + /** @var ISchemaWrapper $schema */ |
|
47 | + $schema = $schemaClosure(); |
|
48 | 48 | |
49 | - if (!$schema->hasTable('calendar_invitations')) { |
|
50 | - $table = $schema->createTable('calendar_invitations'); |
|
49 | + if (!$schema->hasTable('calendar_invitations')) { |
|
50 | + $table = $schema->createTable('calendar_invitations'); |
|
51 | 51 | |
52 | - $table->addColumn('id', Types::BIGINT, [ |
|
53 | - 'autoincrement' => true, |
|
54 | - 'notnull' => true, |
|
55 | - 'length' => 11, |
|
56 | - 'unsigned' => true, |
|
57 | - ]); |
|
58 | - $table->addColumn('uid', Types::STRING, [ |
|
59 | - 'notnull' => true, |
|
60 | - 'length' => 255, |
|
61 | - ]); |
|
62 | - $table->addColumn('recurrenceid', Types::STRING, [ |
|
63 | - 'notnull' => false, |
|
64 | - 'length' => 255, |
|
65 | - ]); |
|
66 | - $table->addColumn('attendee', Types::STRING, [ |
|
67 | - 'notnull' => true, |
|
68 | - 'length' => 255, |
|
69 | - ]); |
|
70 | - $table->addColumn('organizer', Types::STRING, [ |
|
71 | - 'notnull' => true, |
|
72 | - 'length' => 255, |
|
73 | - ]); |
|
74 | - $table->addColumn('sequence', Types::BIGINT, [ |
|
75 | - 'notnull' => false, |
|
76 | - 'length' => 11, |
|
77 | - 'unsigned' => true, |
|
78 | - ]); |
|
79 | - $table->addColumn('token', Types::STRING, [ |
|
80 | - 'notnull' => true, |
|
81 | - 'length' => 60, |
|
82 | - ]); |
|
83 | - $table->addColumn('expiration', Types::BIGINT, [ |
|
84 | - 'notnull' => true, |
|
85 | - 'length' => 11, |
|
86 | - 'unsigned' => true, |
|
87 | - ]); |
|
52 | + $table->addColumn('id', Types::BIGINT, [ |
|
53 | + 'autoincrement' => true, |
|
54 | + 'notnull' => true, |
|
55 | + 'length' => 11, |
|
56 | + 'unsigned' => true, |
|
57 | + ]); |
|
58 | + $table->addColumn('uid', Types::STRING, [ |
|
59 | + 'notnull' => true, |
|
60 | + 'length' => 255, |
|
61 | + ]); |
|
62 | + $table->addColumn('recurrenceid', Types::STRING, [ |
|
63 | + 'notnull' => false, |
|
64 | + 'length' => 255, |
|
65 | + ]); |
|
66 | + $table->addColumn('attendee', Types::STRING, [ |
|
67 | + 'notnull' => true, |
|
68 | + 'length' => 255, |
|
69 | + ]); |
|
70 | + $table->addColumn('organizer', Types::STRING, [ |
|
71 | + 'notnull' => true, |
|
72 | + 'length' => 255, |
|
73 | + ]); |
|
74 | + $table->addColumn('sequence', Types::BIGINT, [ |
|
75 | + 'notnull' => false, |
|
76 | + 'length' => 11, |
|
77 | + 'unsigned' => true, |
|
78 | + ]); |
|
79 | + $table->addColumn('token', Types::STRING, [ |
|
80 | + 'notnull' => true, |
|
81 | + 'length' => 60, |
|
82 | + ]); |
|
83 | + $table->addColumn('expiration', Types::BIGINT, [ |
|
84 | + 'notnull' => true, |
|
85 | + 'length' => 11, |
|
86 | + 'unsigned' => true, |
|
87 | + ]); |
|
88 | 88 | |
89 | - $table->setPrimaryKey(['id']); |
|
90 | - $table->addIndex(['token'], 'calendar_invitation_tokens'); |
|
89 | + $table->setPrimaryKey(['id']); |
|
90 | + $table->addIndex(['token'], 'calendar_invitation_tokens'); |
|
91 | 91 | |
92 | - return $schema; |
|
93 | - } |
|
94 | - } |
|
92 | + return $schema; |
|
93 | + } |
|
94 | + } |
|
95 | 95 | } |
@@ -35,46 +35,46 @@ |
||
35 | 35 | |
36 | 36 | class Version1008Date20181105104826 extends SimpleMigrationStep { |
37 | 37 | |
38 | - /** @var IDBConnection */ |
|
39 | - private $connection; |
|
38 | + /** @var IDBConnection */ |
|
39 | + private $connection; |
|
40 | 40 | |
41 | - /** |
|
42 | - * Version1008Date20181105104826 constructor. |
|
43 | - * |
|
44 | - * @param IDBConnection $connection |
|
45 | - */ |
|
46 | - public function __construct(IDBConnection $connection) { |
|
47 | - $this->connection = $connection; |
|
48 | - } |
|
41 | + /** |
|
42 | + * Version1008Date20181105104826 constructor. |
|
43 | + * |
|
44 | + * @param IDBConnection $connection |
|
45 | + */ |
|
46 | + public function __construct(IDBConnection $connection) { |
|
47 | + $this->connection = $connection; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * @param IOutput $output |
|
52 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
53 | - * @param array $options |
|
54 | - * @return null|ISchemaWrapper |
|
55 | - */ |
|
56 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
57 | - /** @var ISchemaWrapper $schema */ |
|
58 | - $schema = $schemaClosure(); |
|
59 | - $table = $schema->getTable('calendarsubscriptions'); |
|
50 | + /** |
|
51 | + * @param IOutput $output |
|
52 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
53 | + * @param array $options |
|
54 | + * @return null|ISchemaWrapper |
|
55 | + */ |
|
56 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
57 | + /** @var ISchemaWrapper $schema */ |
|
58 | + $schema = $schemaClosure(); |
|
59 | + $table = $schema->getTable('calendarsubscriptions'); |
|
60 | 60 | |
61 | - $table->addColumn('source_copy', Types::TEXT, [ |
|
62 | - 'notnull' => false, |
|
63 | - 'length' => null, |
|
64 | - ]); |
|
61 | + $table->addColumn('source_copy', Types::TEXT, [ |
|
62 | + 'notnull' => false, |
|
63 | + 'length' => null, |
|
64 | + ]); |
|
65 | 65 | |
66 | - return $schema; |
|
67 | - } |
|
66 | + return $schema; |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * @param IOutput $output |
|
71 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
72 | - * @param array $options |
|
73 | - */ |
|
74 | - public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { |
|
75 | - $qb = $this->connection->getQueryBuilder(); |
|
76 | - $qb->update('calendarsubscriptions') |
|
77 | - ->set('source_copy', 'source') |
|
78 | - ->execute(); |
|
79 | - } |
|
69 | + /** |
|
70 | + * @param IOutput $output |
|
71 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
72 | + * @param array $options |
|
73 | + */ |
|
74 | + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { |
|
75 | + $qb = $this->connection->getQueryBuilder(); |
|
76 | + $qb->update('calendarsubscriptions') |
|
77 | + ->set('source_copy', 'source') |
|
78 | + ->execute(); |
|
79 | + } |
|
80 | 80 | } |