diff --git a/lib/Migration/Version000700Date20230916000000.php b/lib/Migration/Version000700Date20230916000000.php index 909214e3d..482cb6632 100644 --- a/lib/Migration/Version000700Date20230916000000.php +++ b/lib/Migration/Version000700Date20230916000000.php @@ -19,6 +19,31 @@ class Version000700Date20230916000000 extends SimpleMigrationStep { + /** + * this is a copy from the definition set in OCA\Tables\Helper\ColumnsHelper + * this has to be in sync! but the definition can not be used directly + * because it might cause problems on auto web updates + * (class might not be loaded if it gets replaced during the runtime) + */ + private array $columns = [ + [ + 'name' => 'text', + 'db_type' => Types::TEXT, + ], + [ + 'name' => 'number', + 'db_type' => Types::FLOAT, + ], + [ + 'name' => 'datetime', + 'db_type' => Types::TEXT, + ], + [ + 'name' => 'selection', + 'db_type' => Types::TEXT, + ], + ]; + /** * @param IOutput $output * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` @@ -32,13 +57,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $this->createRowSleevesTable($schema); - try { - $columnsHelper = Server::get(ColumnsHelper::class); - } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) { - throw new Exception('Could not fetch columns helper which is needed to setup all the tables.'); - } - - $rowTypeSchema = $columnsHelper->get(['name', 'db_type']); + $rowTypeSchema = $this->columns; foreach ($rowTypeSchema as $colType) { $this->createRowValueTable($schema, $colType['name'], $colType['db_type']);