1010namespace OCA \Richdocuments \Migration ;
1111
1212use Closure ;
13+ use Doctrine \DBAL \Types \Type ;
1314use OCP \DB \ISchemaWrapper ;
1415use OCP \Migration \IOutput ;
1516use OCP \Migration \SimpleMigrationStep ;
1920 * Update version column in richdocuments_wopi table to support alphanumeric versions
2021 */
2122class Version10000Date20251217143558 extends SimpleMigrationStep {
22-
23- /**
24- * @param IOutput $output
25- * @param Closure(): ISchemaWrapper $schemaClosure
26- * @param array $options
27- */
28- #[Override]
29- public function preSchemaChange (IOutput $ output , Closure $ schemaClosure , array $ options ): void {
30- }
31-
32- /**
33- * @param IOutput $output
34- * @param Closure(): ISchemaWrapper $schemaClosure
35- * @param array $options
36- * @return null|ISchemaWrapper
37- */
3823 #[Override]
3924 public function changeSchema (IOutput $ output , Closure $ schemaClosure , array $ options ): ?ISchemaWrapper {
4025 /** @var ISchemaWrapper $schema */
@@ -45,33 +30,24 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
4530 }
4631
4732 $ table = $ schema ->getTable ('richdocuments_wopi ' );
48-
33+
4934 if (!$ table ->hasColumn ('version ' )) {
5035 return null ;
5136 }
5237
5338 $ column = $ table ->getColumn ('version ' );
54-
39+
5540 if ($ column ->getType ()->getName () === 'string ' ) {
5641 return null ;
5742 }
5843
5944 $ table ->changeColumn ('version ' , [
60- 'type ' => 'string ' ,
45+ 'type ' => Type:: getType ( 'string ' ) ,
6146 'notnull ' => false ,
6247 'length ' => 1024 ,
6348 'default ' => '0 ' ,
6449 ]);
6550
6651 return $ schema ;
6752 }
68-
69- /**
70- * @param IOutput $output
71- * @param Closure(): ISchemaWrapper $schemaClosure
72- * @param array $options
73- */
74- #[Override]
75- public function postSchemaChange (IOutput $ output , Closure $ schemaClosure , array $ options ): void {
76- }
7753}
0 commit comments