Skip to content

Commit 0c01cde

Browse files
authored
Merge pull request #199 from input-output-hk/erikd/pool-pub-key
db: Remove pub_key column from pool_update table
2 parents af5d398 + 585a9c9 commit 0c01cde

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ insertPoolRegister tracer txId params = do
207207
poolUpdateId <- lift . DB.insertPoolUpdate $
208208
DB.PoolUpdate
209209
{ DB.poolUpdateHashId = poolHashId
210-
, DB.poolUpdatePubKey = Shelley.unKeyHashBS (Shelley._poolPubKey params)
211210
, DB.poolUpdateVrfKey = Crypto.hashToBytes (Shelley._poolVrf params)
212211
, DB.poolUpdatePledge = fromIntegral $ Shelley.unCoin (Shelley._poolPledge params)
213212
, DB.poolUpdateRewardAddrId = rewardId

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ share
156156

157157
PoolUpdate
158158
hashId PoolHashId
159-
pubKey ByteString sqltype=hash28type
160159
vrfKey ByteString sqltype=hash32type
161160
pledge Word64 -- This really should be sqltype=lovelace See https://github.com/input-output-hk/cardano-ledger-specs/issues/1551
162161
rewardAddrId StakeAddressId

schema/migration-2-0003-20200723.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ BEGIN
2323
EXECUTE 'CREATe TABLE "pool_meta_data"("id" SERIAL8 PRIMARY KEY UNIQUE,"url" VARCHAR NOT NULL,"hash" hash32type NOT NULL,"registered_tx_id" INT8 NOT NULL)' ;
2424
EXECUTE 'ALTER TABLE "pool_meta_data" ADD CONSTRAINT "unique_pool_meta_data" UNIQUE("url","hash")' ;
2525
EXECUTE 'ALTER TABLE "pool_meta_data" ADD CONSTRAINT "pool_meta_data_registered_tx_id_fkey" FOREIGN KEY("registered_tx_id") REFERENCES "tx"("id")' ;
26-
EXECUTE 'CREATe TABLE "pool_update"("id" SERIAL8 PRIMARY KEY UNIQUE,"hash_id" INT8 NOT NULL,"pub_key" hash28type NOT NULL,"vrf_key" hash32type NOT NULL,"pledge" INT8 NOT NULL,"reward_addr_id" INT8 NOT NULL,"meta" INT8 NULL,"margin" DOUBLE PRECISION NOT NULL,"fixed_cost" INT8 NOT NULL,"registered_tx_id" INT8 NOT NULL)' ;
26+
EXECUTE 'CREATe TABLE "pool_update"("id" SERIAL8 PRIMARY KEY UNIQUE,"hash_id" INT8 NOT NULL,"vrf_key" hash32type NOT NULL,"pledge" INT8 NOT NULL,"reward_addr_id" INT8 NOT NULL,"meta" INT8 NULL,"margin" DOUBLE PRECISION NOT NULL,"fixed_cost" INT8 NOT NULL,"registered_tx_id" INT8 NOT NULL)' ;
2727
EXECUTE 'ALTER TABLE "pool_update" ADD CONSTRAINT "unique_pool_update" UNIQUE("hash_id","registered_tx_id")' ;
2828
EXECUTE 'ALTER TABLE "pool_update" ADD CONSTRAINT "pool_update_hash_id_fkey" FOREIGN KEY("hash_id") REFERENCES "pool_hash"("id")' ;
2929
EXECUTE 'ALTER TABLE "pool_update" ADD CONSTRAINT "pool_update_reward_addr_id_fkey" FOREIGN KEY("reward_addr_id") REFERENCES "stake_address"("id")' ;

0 commit comments

Comments
 (0)