mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Add missing default value for short url visits count
This commit is contained in:
parent
054eb42613
commit
6fbb5a380d
@ -28,6 +28,7 @@ return static function (ClassMetadata $metadata, array $emConfig): void {
|
||||
$builder->createField('count', Types::BIGINT)
|
||||
->columnName('count')
|
||||
->option('unsigned', true)
|
||||
->option('default', 1)
|
||||
->build();
|
||||
|
||||
$builder->createField('slotId', Types::INTEGER)
|
||||
|
@ -117,9 +117,12 @@ final readonly class ShortUrlVisitsCountPreFlushListener
|
||||
->setParameter('short_url_id', $shortUrlId)
|
||||
->setParameter('potential_bot', $potentialBot)
|
||||
->setParameter('slot_id', $slotId)
|
||||
->forUpdate()
|
||||
->setMaxResults(1);
|
||||
|
||||
if ($conn->getDatabasePlatform()::class === SQLServerPlatform::class) {
|
||||
$qb->forUpdate();
|
||||
}
|
||||
|
||||
$resultSet = $qb->executeQuery()->fetchOne();
|
||||
$writeQb = ! $resultSet
|
||||
? $conn->createQueryBuilder()
|
||||
|
Loading…
Reference in New Issue
Block a user