Create SQL scipts for construction category

This commit is contained in:
MeldaS 2020-04-01 12:15:59 +01:00
parent bdd3462e99
commit 315c028c6a
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,8 @@
ALTER TABLE buildings DROP COLUMN IF EXISTS core_materials;
ALTER TABLE buildings DROP COLUMN IF EXISTS secondary_materials;
ALTER TABLE buildings DROP COLUMN IF EXISTS roof_covering;
DROP TYPE IF EXISTS construction_materials;
DROP TYPE IF EXISTS roof_covering;

View File

@ -0,0 +1,38 @@
-- Launch of Constuction category
-- Fields: Core construction material, Secondary construction materials, Roof covering materials
-- Construction materials: Wood, Stone, Brick, Steel, Reinforced Concrete, Other Metal
-- Other Natural Material, Other Man-Made Material
CREATE TYPE construction_materials
AS ENUM ('Wood',
'Stone',
'Brick',
'Steel',
'Reinforced Concrete',
'Other Metal',
'Other Natural Material',
'Other Man-Made Material');
-- Roof covering materials: Slate, Clay Tile, Wood, Asphalt, Iron or Steel, Other Metal
-- Other Natural Material, Other Man-Made Material
CREATE TYPE roof_covering
AS ENUM ('Slate',
'Clay Tile',
'Wood',
'Asphalt',
'Iron or Steel',
'Other Metal',
'Other Natural Material',
'Other Man-Made Material');
-- Core Construction Material
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS core_materials construction_materials;
-- Secondary Construction Materials
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS secondary_materials construction_materials;
-- Main Roof Covering
ALTER TABLE buildings
ADD COLUMN IF NOT EXISTS roof_covering roof_covering;