You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- -- can only run "use_address_table" on a non populated database but don't throw if the migration was previously set
116
-
-- when (isTxOutVariant && not isTxOutNull && not isTxOutAddressSet) $
117
-
-- throw $
118
-
-- DBExtraMigration "runExtraMigrations: The use of the config 'tx_out.use_address_table' can only be caried out on a non populated database."
119
-
-- -- Make sure the config "use_address_table" is there if the migration wasn't previously set in the past
120
-
-- when (not isTxOutVariant && isTxOutAddressSet) $
121
-
-- throw $
122
-
-- DBExtraMigration "runExtraMigrations: The configuration option 'tx_out.use_address_table' was previously set and the database updated. Unfortunately reverting this isn't possible."
123
-
-- -- Has the user given txout address config && the migration wasn't previously set
124
-
-- when (isTxOutVariant && not isTxOutAddressSet) $ do
125
-
-- updateTxOutAndCreateAddress trce
126
-
-- insertExtraMigration TxOutAddressPreviouslySet
127
-
-- -- first check if pruneTxOut flag is missing and it has previously been used
128
-
-- when (isPruneTxOutPreviouslySet migrationValues && not (pcmPruneTxOut pcm)) $
129
-
-- throw $
130
-
-- DBExtraMigration
131
-
-- "If --prune-tx-out flag is enabled and then db-sync is stopped all future executions of db-sync should still have this flag activated. Otherwise, it is considered bad usage and can cause crashes."
132
-
-- handleMigration migrationValues
133
-
-- where
134
-
-- handleMigration :: (MonadBaseControl IO m, MonadIO m) => MigrationValues -> ReaderT SqlBackend m ()
135
-
-- handleMigration migrationValues@MigrationValues {..} = do
136
-
-- let PruneConsumeMigration {..} = pruneConsumeMigration
137
-
-- case (isConsumeTxOutPreviouslySet, pcmConsumedTxOut, pcmPruneTxOut) of
138
-
-- -- No Migration Needed
139
-
-- (False, False, False) -> do
140
-
-- liftIO $ logInfo trce "runExtraMigrations: No extra migration specified"
-- (True, False, False) -> liftIO $ logAndThrowIO trce "runExtraMigrations: consumed-tx-out or prune-tx-out is not set, but consumed migration is found."
146
-
-- -- Consume TxOut
147
-
-- (False, True, False) -> do
148
-
-- liftIO $ logInfo trce "runExtraMigrations: Running extra migration consumed_tx_out"
149
-
-- insertExtraMigration ConsumeTxOutPreviouslySet
150
-
-- migrateTxOut trce txOutTableType $ Just migrationValues
-- can only run "use_address_table" on a non populated database but don't throw if the migration was previously set
116
+
when (isTxOutVariant &¬ isTxOutNull &¬ isTxOutAddressSet) $
117
+
throw $
118
+
DBExtraMigration"runExtraMigrations: The use of the config 'tx_out.use_address_table' can only be caried out on a non populated database."
119
+
-- Make sure the config "use_address_table" is there if the migration wasn't previously set in the past
120
+
when (not isTxOutVariant && isTxOutAddressSet) $
121
+
throw $
122
+
DBExtraMigration"runExtraMigrations: The configuration option 'tx_out.use_address_table' was previously set and the database updated. Unfortunately reverting this isn't possible."
123
+
-- Has the user given txout address config && the migration wasn't previously set
124
+
when (isTxOutVariant &¬ isTxOutAddressSet) $do
125
+
updateTxOutAndCreateAddress trce
126
+
insertExtraMigration TxOutAddressPreviouslySet
127
+
-- first check if pruneTxOut flag is missing and it has previously been used
128
+
when (isPruneTxOutPreviouslySet migrationValues &¬ (pcmPruneTxOut pcm)) $
129
+
throw $
130
+
DBExtraMigration
131
+
"If --prune-tx-out flag is enabled and then db-sync is stopped all future executions of db-sync should still have this flag activated. Otherwise, it is considered bad usage and can cause crashes."
0 commit comments