kopia lustrzana https://github.com/openmaptiles/openmaptiles
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.pull/1401/head^2
rodzic
da7b1b1645
commit
dc1e21fccc
|
@ -1,9 +1,10 @@
|
||||||
DO
|
DO
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF NOT EXISTS(SELECT 1 FROM pg_type WHERE typname = 'city_place') THEN
|
PERFORM 'city_place'::regtype;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN undefined_object THEN
|
||||||
CREATE TYPE city_place AS enum ('city', 'town', 'village', 'hamlet', 'suburb', 'quarter', 'neighbourhood', 'isolated_dwelling');
|
CREATE TYPE city_place AS enum ('city', 'town', 'village', 'hamlet', 'suburb', 'quarter', 'neighbourhood', 'isolated_dwelling');
|
||||||
END IF;
|
|
||||||
END
|
END
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
DO
|
DO
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF NOT EXISTS(SELECT 1
|
PERFORM 'public_transport_stop_type'::regtype;
|
||||||
FROM pg_type
|
EXCEPTION
|
||||||
WHERE typname = 'public_transport_stop_type') THEN
|
WHEN undefined_object THEN
|
||||||
CREATE TYPE public_transport_stop_type AS enum (
|
CREATE TYPE public_transport_stop_type AS enum (
|
||||||
'subway', 'tram_stop', 'bus_station', 'bus_stop'
|
'subway', 'tram_stop', 'bus_station', 'bus_stop'
|
||||||
);
|
);
|
||||||
END IF;
|
|
||||||
END
|
END
|
||||||
$$;
|
$$;
|
||||||
|
|
|
@ -10,13 +10,14 @@ DROP TRIGGER IF EXISTS trigger_refresh_name ON transportation_name.updates_name;
|
||||||
DO
|
DO
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
IF NOT EXISTS(SELECT 1 FROM pg_type WHERE typname = 'route_network_type') THEN
|
PERFORM 'route_network_type'::regtype;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN undefined_object THEN
|
||||||
CREATE TYPE route_network_type AS enum (
|
CREATE TYPE route_network_type AS enum (
|
||||||
'us-interstate', 'us-highway', 'us-state',
|
'us-interstate', 'us-highway', 'us-state',
|
||||||
'ca-transcanada',
|
'ca-transcanada',
|
||||||
'gb-motorway', 'gb-trunk'
|
'gb-motorway', 'gb-trunk'
|
||||||
);
|
);
|
||||||
END IF;
|
|
||||||
END
|
END
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue