Modify already commited migration

this avoids confusing migration in repository that could damage data, as meaning of the data in database mismatched decription
This commit is contained in:
Mateusz Konieczny 2022-01-31 23:07:35 +01:00
parent a08da58ad3
commit fe94a51da4
7 changed files with 43 additions and 48 deletions

View File

@ -518,7 +518,7 @@
<PolygonSymbolizer fill="#53f5dd" />
</Rule>
<Rule>
<Filter>[current_landuse_order] = "Unclassified, presumed residential"</Filter>
<Filter>[current_landuse_order] = "Unclassified, presumed non-residential"</Filter>
<PolygonSymbolizer fill="#6c6f8e" />
</Rule>
<Rule>

View File

@ -204,7 +204,7 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} =
{ color: '#fa667d', text: 'Agriculture' },
{ color: '#53f5dd', text: 'Minerals' },
{ color: '#ffffff', text: 'Vacant & Derelict' },
{ color: '#6c6f8e', text: 'Unclassified, presumed residential' }
{ color: '#6c6f8e', text: 'Unclassified, presumed non-residential' }
]
},
}],

View File

@ -1,4 +1,4 @@
DELETE FROM reference_tables.landuse_classifications WHERE landuse_id = 'U14X';
DELETE FROM reference_tables.buildings_landuse_order WHERE landuse_id = 'U14X';
DELETE FROM reference_tables.landuse_classifications WHERE landuse_id = 'U072X';
DELETE FROM reference_tables.buildings_landuse_group WHERE landuse_id = 'U072X';
DELETE FROM reference_tables.landuse_classifications WHERE landuse_id = 'U15X';
DELETE FROM reference_tables.buildings_landuse_order WHERE landuse_id = 'U15X';
DELETE FROM reference_tables.landuse_classifications WHERE landuse_id = 'U073X';
DELETE FROM reference_tables.buildings_landuse_group WHERE landuse_id = 'U073X';

View File

@ -3,7 +3,7 @@ INSERT INTO reference_tables.landuse_classifications
(landuse_id, description, level, parent_id, is_used)
VALUES
-- order
('U14X','Unclassified buildings','order',NULL,True);
('U15X','Unclassified, presumed non-residential','order',NULL,True);
-- equivalent to 016 migration
@ -11,7 +11,7 @@ INSERT INTO reference_tables.buildings_landuse_order
(landuse_id, description)
VALUES
-- order
('U14X','Unclassified buildings');
('U15X','Unclassified, presumed non-residential');
-- equivalent to 015 migration
@ -19,7 +19,7 @@ INSERT INTO reference_tables.landuse_classifications
(landuse_id, description, level, parent_id, is_used)
VALUES
-- group
('U072X','Unclassified, likely residential','group','U14X',True);
('U073X','Unclassified, presumed non-residential','group','U15X',True);
-- equivalent to 016 migration
@ -27,4 +27,4 @@ INSERT INTO reference_tables.buildings_landuse_group
(landuse_id, description, parent_order_id)
VALUES
-- group
('U072X','Unclassified, likely residential','U14X');
('U073X','Unclassified, presumed non-residential','U15X');

33
migrations/025.actual.sql Normal file
View File

@ -0,0 +1,33 @@
INSERT INTO reference_tables.landuse_classifications
(landuse_id, description, level, parent_id, is_used)
VALUES
('U15X','Unclassified, presumed non-residential','order',NULL,True);
INSERT INTO reference_tables.buildings_landuse_order
(landuse_id, description)
VALUES
('U15X','Unclassified, presumed non-residential');
INSERT INTO reference_tables.landuse_classifications
(landuse_id, description, level, parent_id, is_used)
VALUES
('U073X','Unclassified, presumed non-residential','group','U15X',True);
INSERT INTO reference_tables.buildings_landuse_group
(landuse_id, description, parent_order_id)
VALUES
('U073X','Unclassified, presumed non-residential', 'U15X');
UPDATE buildings
SET current_landuse_order = 'Unclassified, presumed non-residential'
WHERE current_landuse_order = 'Unclassified buildings';
DELETE FROM reference_tables.landuse_classifications
WHERE landuse_id='U14X';
DELETE FROM reference_tables.buildings_landuse_order
WHERE landuse_id='U14X';
DELETE FROM reference_tables.landuse_classifications
WHERE landuse_id='U072X';
DELETE FROM reference_tables.buildings_landuse_group
WHERE landuse_id='U072X';

View File

@ -1,19 +0,0 @@
INSERT INTO reference_tables.landuse_classifications
(landuse_id, description, level, parent_id, is_used)
VALUES
('U14X','Unclassified buildings','order',NULL,True);
INSERT INTO reference_tables.buildings_landuse_order
(landuse_id, description)
VALUES
('U14X','Unclassified buildings');
UPDATE buildings
SET current_landuse_order = 'Unclassified buildings'
WHERE current_landuse_order = 'Unclassified, presumed residential';
DELETE FROM reference_tables.landuse_classifications
WHERE landuse_id='U15X';
DELETE FROM reference_tables.buildings_landuse_order
WHERE landuse_id='U15X';

View File

@ -1,19 +0,0 @@
INSERT INTO reference_tables.landuse_classifications
(landuse_id, description, level, parent_id, is_used)
VALUES
('U15X','Unclassified, presumed residential','order',NULL,True);
INSERT INTO reference_tables.buildings_landuse_order
(landuse_id, description)
VALUES
('U15X','Unclassified, presumed residential');
UPDATE buildings
SET current_landuse_order = 'Unclassified, presumed residential'
WHERE current_landuse_order = 'Unclassified buildings';
DELETE FROM reference_tables.landuse_classifications
WHERE landuse_id='U14X';
DELETE FROM reference_tables.buildings_landuse_order
WHERE landuse_id='U14X';