Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Committee keys size #1544

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() ;
Loading