Skip to content

Commit d2248ed

Browse files
committed
Fix migration error on checkpoint table
SQLite doesn't support removing columns, so we put them back as "unused" fields. https://www.sqlite.org/lang_altertable.html#altertableishard Closes #1621
1 parent 76f0c97 commit d2248ed

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/core/src/Cardano/Wallet/DB/Sqlite.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ mkCheckpointEntity wid wal =
748748
, checkpointEpochStability = coerce (bp ^. #getEpochStability)
749749
, checkpointActiveSlotCoeff =
750750
W.unActiveSlotCoefficient (bp ^. #getActiveSlotCoefficient)
751+
, checkpointFeePolicyUnused = ""
752+
, checkpointTxMaxSizeUnused = 0
751753
}
752754
utxo =
753755
[ UTxO wid sl (TxId input) ix addr coin
@@ -776,8 +778,10 @@ checkpointFromEntity cp utxo s =
776778
bh
777779
(BlockId genesisHash)
778780
genesisStart
781+
_feePolicyUnused
779782
slotLength
780783
epochLength
784+
_txMaxSizeUnused
781785
epochStability
782786
activeSlotCoeff
783787
) = cp

lib/core/src/Cardano/Wallet/DB/Sqlite/TH.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ Checkpoint
133133
checkpointBlockHeight Word32 sql=block_height
134134
checkpointGenesisHash BlockId sql=genesis_hash
135135
checkpointGenesisStart UTCTime sql=genesis_start
136+
checkpointFeePolicyUnused Text sql=fee_policy
136137
checkpointSlotLength Word64 sql=slot_length
137138
checkpointEpochLength Word32 sql=epoch_length
139+
checkpointTxMaxSizeUnused Word16 sql=tx_max_size
138140
checkpointEpochStability Word32 sql=epoch_stability
139141
checkpointActiveSlotCoeff Double sql=active_slot_coeff
140142

0 commit comments

Comments
 (0)