Skip to content

Commit bec5dad

Browse files
committed
1 parent a1e0378 commit bec5dad

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cardano-db-sync/src/Cardano/DbSync/Rollback.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ rollbackFromBlockNo syncEnv blkNo = do
5252
whenConsumeOrPruneTxOut syncEnv $
5353
DB.setNullTxOut trce mTxId
5454
DB.deleteEpochRows epochNo
55+
DB.deleteDrepDistr epochNo
5556
DB.setNullEnacted epochNo
5657
DB.setNullRatified epochNo
5758
DB.setNullDropped epochNo

cardano-db/src/Cardano/Db/Delete.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module Cardano.Db.Delete (
1414
deleteBlocksBlockIdNotrace,
1515
deleteBlock,
1616
deleteEpochRows,
17+
deleteDrepDistr,
1718
deleteAdaPots,
1819
deleteTxOut,
1920
-- for testing
@@ -45,6 +46,7 @@ import Database.Persist.Sql (
4546
selectKeysList,
4647
(==.),
4748
(>=.),
49+
(>.),
4850
)
4951

5052
deleteBlocksSlotNoNoTrace :: MonadIO m => SlotNo -> ReaderT SqlBackend m Bool
@@ -220,6 +222,10 @@ deleteEpochRows :: MonadIO m => Word64 -> ReaderT SqlBackend m ()
220222
deleteEpochRows epochNum =
221223
deleteWhere [EpochNo >=. epochNum]
222224

225+
deleteDrepDistr :: MonadIO m => Word64 -> ReaderT SqlBackend m ()
226+
deleteDrepDistr epochNum =
227+
deleteWhere [DrepDistrEpochNo >. epochNum]
228+
223229
deleteAdaPots :: MonadIO m => BlockId -> ReaderT SqlBackend m ()
224230
deleteAdaPots blkId = do
225231
deleteWhere [AdaPotsBlockId ==. blkId]

0 commit comments

Comments
 (0)