diff --git a/layers/place/capital.sql b/layers/place/capital.sql index 33756478..11221094 100644 --- a/layers/place/capital.sql +++ b/layers/place/capital.sql @@ -2,8 +2,8 @@ CREATE OR REPLACE FUNCTION normalize_capital_level(capital text) RETURNS int AS $$ SELECT CASE - WHEN capital IN ('yes', '2') THEN 2 - WHEN capital = '4' THEN 4 + WHEN capital = 'yes' THEN 2 + WHEN capital IN ('2', '3', '4', '5', '6') THEN capital::int END; $$ LANGUAGE SQL IMMUTABLE STRICT