colouring-montreal/migrations/009.landuse.down.sql
Dominic H 68a9fd1b80 WIP for #358
- Switched from ENUM to table 
- Final steps to complete
2019-09-18 15:59:06 +01:00

15 lines
780 B
SQL

-- Remove planning and controls fields
--Landuse is hierachical. Highest level is Order (Residential) then Group (Residential-Dwelling) then Class (Residential-Dwelling-Detached house)
--Fields could be linked when not mixed use Example: If user inputs class field (Detached-House) on front end then trigger on db automatically will populate group and order. If we go this route then a trigger is needed on the db both to run and remove this process.
-- Land use, single or mutiple classes?
ALTER TABLE buildings DROP COLUMN IF EXISTS landuse_mutiple_use;
-- Land use, how many different uses?
ALTER TABLE buildings DROP COLUMN IF EXISTS landuse_number_of_uses;
--Land use class, group and order will be stored in a new table
DROP TABLE building_landuse IF EXISTS CASCADE;