-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1105 from cityofaustin/jc-delete-construction-ins…
…pection-work-type Deletes "Construction Inspection" work type
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
moped-database/migrations/1692285495049_delete_work_type_construction_inspection/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
INSERT INTO moped_work_types (name, key) VALUES | ||
('Construction Inspection', 'construction_inspection'); | ||
|
||
-- add as allowed work type for signal components | ||
-- see 1691442787520_refresh-component-work-types | ||
WITH inserts_todo AS ( | ||
SELECT | ||
id AS work_type_id, | ||
component_id | ||
FROM ( | ||
values('construction_inspection')) AS data (work_type_key) | ||
LEFT JOIN moped_components ON TRUE | ||
LEFT JOIN moped_work_types mwt ON data.work_type_key = mwt.key | ||
WHERE | ||
moped_components.is_deleted = FALSE | ||
AND lower(moped_components.component_name) = 'signal' | ||
AND(lower(moped_components.component_subtype) = 'traffic' | ||
OR lower(moped_components.component_subtype) = 'phb') | ||
) INSERT INTO moped_component_work_types (work_type_id, component_id) | ||
SELECT | ||
* | ||
FROM | ||
inserts_todo; |
1 change: 1 addition & 0 deletions
1
moped-database/migrations/1692285495049_delete_work_type_construction_inspection/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DELETE FROM moped_work_types WHERE KEY = 'construction_inspection'; |