Skip to content

Commit

Permalink
Fix Committee keys size
Browse files Browse the repository at this point in the history
Fixes #1543
  • Loading branch information
kderme committed Oct 23, 2023
1 parent 6cd37a3 commit 68a1ab0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cardano-db/src/Cardano/Db/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,13 @@ share
CommitteeRegistration
txId TxId noreference
certIndex Word16
coldKey ByteString sqltype=addr29type
hotKey ByteString sqltype=addr29type
coldKey ByteString sqltype=bytea
hotKey ByteString sqltype=bytea

CommitteeDeRegistration
txId TxId noreference
certIndex Word16
hotKey ByteString sqltype=addr29type
hotKey ByteString sqltype=bytea

DrepRegistration
txId TxId noreference
Expand Down
21 changes: 21 additions & 0 deletions schema/migration-2-0029-20231009.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Persistent generated migration.

CREATE FUNCTION migrate() RETURNS void AS $$
DECLARE
next_version int ;
BEGIN
SELECT stage_two + 1 INTO next_version FROM schema_version ;
IF next_version = 29 THEN
ALTER TABLE committee_registration ALTER COLUMN cold_key SET DATA TYPE bytea;
ALTER TABLE committee_registration ALTER COLUMN hot_key SET DATA TYPE bytea;
ALTER TABLE committee_de_registration ALTER COLUMN hot_key SET DATA TYPE bytea;
-- Hand written SQL statements can be added here.
UPDATE schema_version SET stage_two = next_version ;
RAISE NOTICE 'DB has been migrated to stage_two version %', next_version ;
END IF ;
END ;
$$ LANGUAGE plpgsql ;

SELECT migrate() ;

DROP FUNCTION migrate() ;

0 comments on commit 68a1ab0

Please sign in to comment.