The finalization pass was a dumb idea. We'll just put the per-table/concept sanitization in their file. We need these to happen before the other scripts run because we denormalize the data for performance.

master
dtookey 4 years ago
parent efbe425e35
commit 78bbd9a706

@ -3,31 +3,58 @@ DROP TABLE IF EXISTS all_projects;
#todo we have to find out how to generate this from the info on tablemetadata
CREATE TABLE all_projects AS SELECT * FROM CLT2019
CREATE TABLE all_projects AS
SELECT *
FROM CLT2019
UNION
SELECT * FROM CLT2020
SELECT *
FROM CLT2020
UNION
SELECT * FROM CLT2021
SELECT *
FROM CLT2021
UNION
SELECT * FROM CLT2022
SELECT *
FROM CLT2022
UNION
SELECT * FROM RDU2019
SELECT *
FROM RDU2019
UNION
SELECT * FROM RDU2020
SELECT *
FROM RDU2020
UNION
SELECT * FROM RDU2021
SELECT *
FROM RDU2021
UNION
SELECT * FROM RDU2022
SELECT *
FROM RDU2022
UNION
SELECT * FROM ENV2020
SELECT *
FROM ENV2020
UNION
SELECT * FROM ENV2021
SELECT *
FROM ENV2021
UNION
SELECT * FROM ENV2022
SELECT *
FROM ENV2022
UNION
SELECT * FROM SRV2020
SELECT *
FROM SRV2020
UNION
SELECT * FROM SRV2021;
SELECT *
FROM SRV2021;
CREATE UNIQUE INDEX ref_num ON all_projects(refnum);
CREATE INDEX project_flavor ON all_projects(proj_type);
CREATE UNIQUE INDEX ref_num ON all_projects (refnum);
CREATE INDEX project_flavor ON all_projects (proj_type);
UPDATE all_projects
SET description = TRIM(BOTH ' ' FROM description)
WHERE description RLIKE '^ '
OR description RLIKE ' $';
UPDATE all_projects
SET description = 'Soil/Footings'
WHERE description IN
(
'Soils/Footings'
);

@ -1,10 +0,0 @@
UPDATE all_projects
set description = TRIM(both ' ' from description)
where description rlike '^ ' or description rlike ' $';
UPDATE all_projects
set description = 'Soil/Footings'
where description in
(
'Soils/Footings'
);
Loading…
Cancel
Save