Create SQL scipts for construction category
This commit is contained in:
parent
bdd3462e99
commit
315c028c6a
8
migrations/0xx.construction-materials.down.sql
Normal file
8
migrations/0xx.construction-materials.down.sql
Normal 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;
|
38
migrations/0xx.construction-materials.up.sql
Normal file
38
migrations/0xx.construction-materials.up.sql
Normal 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;
|
Loading…
Reference in New Issue
Block a user