Skip to content

Commit

Permalink
Merge pull request #122 from RonasIT/fix-codestyle
Browse files Browse the repository at this point in the history
Minor code style fix
  • Loading branch information
DenTray committed May 20, 2024
2 parents 878cdba + 097efb0 commit 63b7935
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Traits/FixturesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ public function prepareSequences(array $except = []): void
return '';
} else {
$sequenceName = str_replace(["nextval('", "'::regclass)"], '', $item->column_default);
$tableName = "{$item->table_schema}.{$item->table_name}";

return "SELECT setval('{$sequenceName}', (select coalesce(max({$item->column_name}), 1) from " .
"{$item->table_schema}.{$item->table_name}), (case when (select max({$item->column_name}) from {$item->table_schema}.{$item->table_name}) " .
"{$tableName}), (case when (select max({$item->column_name}) from {$tableName}) " .
"is NULL then false else true end));\n";

}
});

Expand Down

0 comments on commit 63b7935

Please sign in to comment.