Skip to content

Commit 17f4dd7

Browse files
authored
Merge pull request #264 from input-output-hk/erikd/pparams
db: Fix ParamUpdate table entry names
2 parents c615bd2 + 7e599f0 commit 17f4dd7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Insert.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,11 @@ insertParamUpdate _tracer txId (Shelley.Update (Shelley.ProposedPPUpdates umap)
464464
, DB.paramUpdateKeyDeposit = fromIntegral . Shelley.unCoin <$> strictMaybeToMaybe (Shelley._keyDeposit pmap)
465465
, DB.paramUpdatePoolDeposit = fromIntegral . Shelley.unCoin <$> strictMaybeToMaybe (Shelley._poolDeposit pmap)
466466
, DB.paramUpdateMaxEpoch = unEpochNo <$> strictMaybeToMaybe (Shelley._eMax pmap)
467-
, DB.paramUpdateNOptimal = fromIntegral <$> strictMaybeToMaybe (Shelley._nOpt pmap)
467+
, DB.paramUpdateOptimalPoolCount = fromIntegral <$> strictMaybeToMaybe (Shelley._nOpt pmap)
468468
, DB.paramUpdateInfluence = fromRational <$> strictMaybeToMaybe (Shelley._a0 pmap)
469469
, DB.paramUpdateMonetaryExpandRate = Shelley.unitIntervalToDouble <$> strictMaybeToMaybe (Shelley._rho pmap)
470470
, DB.paramUpdateTreasuryGrowthRate = Shelley.unitIntervalToDouble <$> strictMaybeToMaybe (Shelley._tau pmap)
471-
, DB.paramUpdateActiveSlotCoeff = Shelley.unitIntervalToDouble <$> strictMaybeToMaybe (Shelley._d pmap)
471+
, DB.paramUpdateDecentralisation = Shelley.unitIntervalToDouble <$> strictMaybeToMaybe (Shelley._d pmap)
472472
, DB.paramUpdateEntropy = Shelley.nonceToBytes <$> strictMaybeToMaybe (Shelley._extraEntropy pmap)
473473
, DB.paramUpdateProtocolVersion = textShow <$> strictMaybeToMaybe (Shelley._protocolVersion pmap)
474474
, DB.paramUpdateMinUTxOValue = fromIntegral . Shelley.unCoin <$> strictMaybeToMaybe (Shelley._minUTxOValue pmap)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@ share
285285
keyDeposit Word64 Maybe sqltype=lovelace
286286
poolDeposit Word64 Maybe sqltype=lovelace
287287
maxEpoch Word64 Maybe sqltype=uinteger
288-
nOptimal Word64 Maybe sqltype=uinteger
288+
optimalPoolCount Word64 Maybe sqltype=uinteger
289289
influence Double Maybe -- sqltype=rational
290290
monetaryExpandRate Double Maybe -- sqltype=interval
291291
treasuryGrowthRate Double Maybe -- sqltype=interval
292-
activeSlotCoeff Double Maybe -- sqltype=interval
292+
decentralisation Double Maybe -- sqltype=interval
293293
entropy ByteString Maybe sqltype=hash32type
294294
protocolVersion Text Maybe
295295
minUTxOValue Word64 Maybe sqltype=lovelace

schema/migration-2-0003-20200820.sql renamed to schema/migration-2-0003-20200824.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ BEGIN
8181
EXECUTE 'ALTER TABLE "treasury" ADD CONSTRAINT "unique_treasury" UNIQUE("addr_id","tx_id")' ;
8282
EXECUTE 'ALTER TABLE "treasury" ADD CONSTRAINT "treasury_addr_id_fkey" FOREIGN KEY("addr_id") REFERENCES "stake_address"("id")' ;
8383
EXECUTE 'ALTER TABLE "treasury" ADD CONSTRAINT "treasury_tx_id_fkey" FOREIGN KEY("tx_id") REFERENCES "tx"("id")' ;
84-
EXECUTE 'CREATe TABLE "param_update"("id" SERIAL8 PRIMARY KEY UNIQUE,"epoch_no" uinteger NOT NULL,"key" hash28type NOT NULL,"min_fee_a" uinteger NULL,"min_fee_b" uinteger NULL,"max_block_size" uinteger NULL,"max_tx_size" uinteger NULL,"max_bh_size" uinteger NULL,"key_deposit" lovelace NULL,"pool_deposit" lovelace NULL,"max_epoch" uinteger NULL,"n_optimal" uinteger NULL,"influence" DOUBLE PRECISION NULL,"monetary_expand_rate" DOUBLE PRECISION NULL,"treasury_growth_rate" DOUBLE PRECISION NULL,"active_slot_coeff" DOUBLE PRECISION NULL,"entropy" hash32type NULL,"protocol_version" VARCHAR NULL,"min_u_tx_o_value" lovelace NULL,"min_pool_cost" lovelace NULL,"registered_tx_id" INT8 NOT NULL)' ;
84+
EXECUTE 'CREATe TABLE "param_update"("id" SERIAL8 PRIMARY KEY UNIQUE,"epoch_no" uinteger NOT NULL,"key" hash28type NOT NULL,"min_fee_a" uinteger NULL,"min_fee_b" uinteger NULL,"max_block_size" uinteger NULL,"max_tx_size" uinteger NULL,"max_bh_size" uinteger NULL,"key_deposit" lovelace NULL,"pool_deposit" lovelace NULL,"max_epoch" uinteger NULL,"optimal_pool_count" uinteger NULL,"influence" DOUBLE PRECISION NULL,"monetary_expand_rate" DOUBLE PRECISION NULL,"treasury_growth_rate" DOUBLE PRECISION NULL,"decentralisation" DOUBLE PRECISION NULL,"entropy" hash32type NULL,"protocol_version" VARCHAR NULL,"min_u_tx_o_value" lovelace NULL,"min_pool_cost" lovelace NULL,"registered_tx_id" INT8 NOT NULL)' ;
8585
EXECUTE 'ALTER TABLE "param_update" ADD CONSTRAINT "unique_param_update" UNIQUE("key","registered_tx_id")' ;
8686
EXECUTE 'ALTER TABLE "param_update" ADD CONSTRAINT "param_update_registered_tx_id_fkey" FOREIGN KEY("registered_tx_id") REFERENCES "tx"("id")' ;
8787
-- Hand written SQL statements can be added here.

0 commit comments

Comments
 (0)