Change typecheck to perform within the current namespace/schema (#1389)
This PR fixes #1388 by doing a test cast for the type and if it fails adding the type.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
DO
|
||||
$$
|
||||
BEGIN
|
||||
IF NOT EXISTS(SELECT 1
|
||||
FROM pg_type
|
||||
WHERE typname = 'public_transport_stop_type') THEN
|
||||
PERFORM 'public_transport_stop_type'::regtype;
|
||||
EXCEPTION
|
||||
WHEN undefined_object THEN
|
||||
CREATE TYPE public_transport_stop_type AS enum (
|
||||
'subway', 'tram_stop', 'bus_station', 'bus_stop'
|
||||
);
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
Reference in New Issue
Block a user