Skip to content

Commit

Permalink
Merge #1735
Browse files Browse the repository at this point in the history
1735: Clean up old TxParameters SQL table r=KtorZ a=rvl

### Issue Number

Closes #1727

### Overview

Remove an old SQL table, if it exists.


Co-authored-by: Rodney Lorrimar <[email protected]>
  • Loading branch information
iohk-bors[bot] and rvl authored Jun 12, 2020
2 parents 4cd2ce6 + 2fa5f70 commit 2a540bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/core/src/Cardano/Wallet/DB/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ migrateManually tr defaultFieldValues =
-- really be removed as soon as we have a fix for the cardano-sl:wallet
-- currently in production.
removeSoftRndAddresses conn

removeOldTxParametersTable conn
where
-- NOTE
-- Wallets created before the 'PassphraseScheme' was introduced have no
Expand Down Expand Up @@ -436,6 +438,13 @@ migrateManually tr defaultFieldValues =
$ W.unActiveSlotCoefficient
$ defaultActiveSlotCoefficient defaultFieldValues

-- | This table became @protocol_parameters@.
removeOldTxParametersTable :: Sqlite.Connection -> IO ()
removeOldTxParametersTable conn = do
dropTable <- Sqlite.prepare conn "DROP TABLE IF EXISTS tx_parameters;"
void $ Sqlite.stepConn conn dropTable
Sqlite.finalize dropTable

-- | Determines whether a field is present in its parent table.
isFieldPresent :: Sqlite.Connection -> DBField -> IO SqlColumnStatus
isFieldPresent conn field = do
Expand Down

0 comments on commit 2a540bd

Please sign in to comment.