Skip to content

Commit e23915c

Browse files
committed
migration script fixes
1 parent b718cbd commit e23915c

File tree

3 files changed

+2386
-6
lines changed

3 files changed

+2386
-6
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ EXTVERSION = 1.3
1616
DATA_built = pg_pathman--$(EXTVERSION).sql
1717

1818
DATA = pg_pathman--1.0--1.1.sql \
19-
pg_pathman--1.1--1.2.sql
19+
pg_pathman--1.1--1.2.sql \
20+
pg_pathman--1.2--1.3.sql
2021

2122
PGFILEDESC = "pg_pathman - partitioning tool"
2223

pg_pathman--1.2--1.3.sql

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ ALTER TABLE @extschema@.pathman_config
1414
ADD CHECK (@extschema@.validate_interval_value(partrel,
1515
attname,
1616
parttype,
17-
range_interval))
17+
range_interval));
1818

19-
/* TODO! Write a convertation */
19+
/* Change type for init_callback attribute */
2020
ALTER TABLE @extschema@.pathman_config_params
21-
ALTER COLUMN init_callback TYPE TEXT DEFAULT NULL;
21+
ALTER COLUMN init_callback TYPE TEXT,
22+
ALTER COLUMN init_callback SET DEFAULT NULL;
2223

23-
DROP FUNCTION validate_part_callback(REGPROC, BOOL);
24+
/* Set init_callback to NULL where it used to be 0 */
25+
UPDATE @extschema@.pathman_config_params
26+
SET init_callback = NULL
27+
WHERE init_callback = '-';
28+
29+
DROP FUNCTION @extschema@.validate_part_callback(REGPROC, BOOL);
2430

2531
CREATE OR REPLACE FUNCTION @extschema@.validate_part_callback(
2632
callback REGPROCEDURE,
@@ -32,7 +38,7 @@ ALTER TABLE @extschema@.pathman_config_params
3238
ADD CHECK (@extschema@.validate_part_callback(CASE WHEN init_callback IS NULL
3339
THEN 0::REGPROCEDURE
3440
ELSE init_callback::REGPROCEDURE
35-
END))
41+
END));
3642

3743
/* ------------------------------------------------------------------------
3844
* Drop irrelevant objects

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy