Skip to content

Commit

Permalink
Fix version for uuid expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Dec 12, 2024
1 parent 33c11f2 commit 1c743a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Column/ColumnDefinitionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected function getDefaultUuidExpression(): string
{
$serverVersion = $this->queryBuilder->getServerInfo()->getVersion();

if (version_compare($serverVersion, '12', '<')) {
if (version_compare($serverVersion, '13', '<')) {
return "uuid_in(overlay(overlay(md5(now()::text || random()::text) placing '4' from 13) placing"
. ' to_hex(floor(4 * random() + 8)::int)::text from 17)::cstring)';
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Provider/QueryBuilderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public static function buildColumnDefinition(): array
$serverVersion = self::getDb()->getServerInfo()->getVersion();
$db->close();

if (version_compare($serverVersion, '12', '<')) {
if (version_compare($serverVersion, '13', '<')) {
$uuidExpression = "uuid_in(overlay(overlay(md5(now()::text || random()::text) placing '4' from 13) placing"
. ' to_hex(floor(4 * random() + 8)::int)::text from 17)::cstring)';

Expand Down

0 comments on commit 1c743a6

Please sign in to comment.