Skip to content

Commit fd98ed6

Browse files
committed
Drop uneeded checks from domains
Fixes #1584
1 parent 2e79ee4 commit fd98ed6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

schema/migration-2-0035-20240108.sql

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 = 35 THEN
9+
EXECUTE 'alter domain addr29type drop constraint addr29type_check' ;
10+
EXECUTE 'alter domain asset32type drop constraint asset32type_check' ;
11+
EXECUTE 'alter domain hash28type drop constraint hash28type_check' ;
12+
EXECUTE 'alter domain hash32type drop constraint hash32type_check' ;
13+
EXECUTE 'alter domain int65type drop constraint int65type_check' ;
14+
EXECUTE 'alter domain lovelace drop constraint lovelace_check' ;
15+
EXECUTE 'alter domain txindex drop constraint txindex_check' ;
16+
EXECUTE 'alter domain word128type drop constraint word128type_check' ;
17+
EXECUTE 'alter domain word31type drop constraint word31type_check' ;
18+
EXECUTE 'alter domain word63type drop constraint word63type_check' ;
19+
EXECUTE 'alter domain word64type drop constraint word64type_check' ;
20+
-- Hand written SQL statements can be added here.
21+
UPDATE schema_version SET stage_two = next_version ;
22+
RAISE NOTICE 'DB has been migrated to stage_two version %', next_version ;
23+
END IF ;
24+
END ;
25+
$$ LANGUAGE plpgsql ;
26+
27+
SELECT migrate() ;
28+
29+
DROP FUNCTION migrate() ;

0 commit comments

Comments
 (0)