File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ CREATE FUNCTION migrate () RETURNS void AS $$
2+ DECLARE
3+ next_version int ;
4+ BEGIN
5+ SELECT stage_three + 1 INTO next_version FROM schema_version ;
6+ IF next_version <= 4 THEN
7+ -- -------------------------------------------------------------------------
8+ -- More hand crafted indices for performance
9+
10+ -- helpful in case anyone is looking for a utxo by a payment credential.
11+
12+ CREATE INDEX idx_tx_out_payment_cred
13+ ON tx_out(payment_cred);
14+
15+ CREATE INDEX idx_pool_update_hash_id
16+ ON pool_update(hash_id);
17+
18+ -- -------------------------------------------------------------------------
19+
20+ UPDATE schema_version SET stage_three = 4 ;
21+ RAISE NOTICE ' DB has been migrated to stage_three version %' , next_version ;
22+ END IF ;
23+ END ;
24+ $$ LANGUAGE plpgsql ;
25+
26+ SELECT migrate() ;
27+
28+ DROP FUNCTION migrate() ;
You can’t perform that action at this time.
0 commit comments