Skip to content

Commit

Permalink
Fixes migration of existing data
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Hempel <Philipp.Hempel1@web.de>
  • Loading branch information
Hephi2 committed Jul 20, 2023
1 parent 15ae5de commit b714887
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Service/TableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,11 @@ private function enhanceTable(Table &$table, string $userId): void {
// add the corresponding views
try {
$table->setBaseView($this->viewService->findBaseView($table));
} catch (NotFoundError $e) {
//TODO: Create new base view if none exists
} catch (DoesNotExistException $e) {
// Create new base view if none exists
$view = $this->viewService->create($table->getTitle(), $table->getEmoji(), $table, true);
$view = $this->viewService->update($view->getId(), ["columns" => json_encode(array_column($this->columnService->findAllByTable($table->getId()),'id'))]);
$table->setBaseView($view);
}
$table->setViews($this->viewService->findAllNotBaseViews($table));
}
Expand Down

0 comments on commit b714887

Please sign in to comment.