File tree 2 files changed +24
-3
lines changed
cardano-db/src/Cardano/Db
2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -557,13 +557,13 @@ share
557
557
CommitteeRegistration
558
558
txId TxId noreference
559
559
certIndex Word16
560
- coldKey ByteString sqltype=addr29type
561
- hotKey ByteString sqltype=addr29type
560
+ coldKey ByteString sqltype=bytea
561
+ hotKey ByteString sqltype=bytea
562
562
563
563
CommitteeDeRegistration
564
564
txId TxId noreference
565
565
certIndex Word16
566
- hotKey ByteString sqltype=addr29type
566
+ hotKey ByteString sqltype=bytea
567
567
568
568
DrepRegistration
569
569
txId TxId noreference
Original file line number Diff line number Diff line change
1
+ -- Persistent generated migration.
2
+
3
+ CREATE FUNCTION migrate () RETURNS void AS $$
4
+ DECLARE
5
+ next_version int ;
6
+ BEGIN
7
+ SELECT stage_two + 1 INTO next_version FROM schema_version ;
8
+ IF next_version = 29 THEN
9
+ ALTER TABLE committee_registration ALTER COLUMN cold_key SET DATA TYPE bytea ;
10
+ ALTER TABLE committee_registration ALTER COLUMN hot_key SET DATA TYPE bytea ;
11
+ ALTER TABLE committee_de_registration ALTER COLUMN hot_key SET DATA TYPE bytea ;
12
+ -- Hand written SQL statements can be added here.
13
+ UPDATE schema_version SET stage_two = next_version ;
14
+ RAISE NOTICE ' DB has been migrated to stage_two version %' , next_version ;
15
+ END IF ;
16
+ END ;
17
+ $$ LANGUAGE plpgsql ;
18
+
19
+ SELECT migrate() ;
20
+
21
+ DROP FUNCTION migrate() ;
You can’t perform that action at this time.
0 commit comments