From 1a6df005992d1e5e7f22352936441bd55f796e32 Mon Sep 17 00:00:00 2001 From: Maxandre Ogeret Date: Tue, 11 Jun 2019 15:37:54 +0000 Subject: [PATCH] reset sblink sequence when truncating --- src/Repository/SBLinkRepository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Repository/SBLinkRepository.php b/src/Repository/SBLinkRepository.php index 8638efe..62540f7 100644 --- a/src/Repository/SBLinkRepository.php +++ b/src/Repository/SBLinkRepository.php @@ -45,6 +45,7 @@ private function truncate() $connection->beginTransaction(); try { $connection->query('truncate table '.$cmd->getTableName()); + $connection->query('ALTER SEQUENCE sblink_id_seq RESTART with 1;'); $connection->commit(); } catch (\Exception $e) { $connection->rollback();