mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-27 22:45:03 +00:00
Merge pull request #436 from Hestia-Homes/issue-407-seed-reference-data
feat(ara-projects): seed project_type and workstream reference data
This commit is contained in:
commit
7e54e64125
3 changed files with 13155 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
-- Seed the project_type and workstream reference tables (issue #407).
|
||||
--
|
||||
-- Neither table has a unique constraint on `name`, so idempotency is expressed
|
||||
-- with NOT EXISTS rather than ON CONFLICT. Re-running is a no-op; existing rows
|
||||
-- are left untouched, including any hand-edited description.
|
||||
|
||||
INSERT INTO project_type (name)
|
||||
SELECT v.name
|
||||
FROM (VALUES
|
||||
('Retrofit'),
|
||||
('Planned Maintenance')
|
||||
) AS v(name)
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM project_type pt WHERE pt.name = v.name
|
||||
);
|
||||
--> statement-breakpoint
|
||||
INSERT INTO workstream (name, description)
|
||||
SELECT v.name, v.description
|
||||
FROM (VALUES
|
||||
('Windows', 'Replacement and repair of windows, including glazing upgrades.'),
|
||||
('Doors', 'Replacement and repair of external, internal and communal doors.'),
|
||||
('Roofs', 'Roof covering replacement and repair, including rainwater goods.'),
|
||||
('Kitchens', 'Replacement and refurbishment of kitchens.'),
|
||||
('Bathrooms', 'Replacement and refurbishment of bathrooms and wet rooms.'),
|
||||
('Asbestos', 'Asbestos survey, management, encapsulation and removal works.'),
|
||||
('Electrical heating', 'Installation and upgrade of electrical heating systems and controls.'),
|
||||
('Cyclical decorations', 'Planned cyclical internal and external decoration.')
|
||||
) AS v(name, description)
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM workstream w WHERE w.name = v.name
|
||||
);
|
||||
13117
src/app/db/migrations/meta/0274_snapshot.json
Normal file
13117
src/app/db/migrations/meta/0274_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1912,6 +1912,13 @@
|
|||
"when": 1784546553566,
|
||||
"tag": "0273_normal_bloodstrike",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 274,
|
||||
"version": "7",
|
||||
"when": 1784631274000,
|
||||
"tag": "0274_seed_project_type_and_workstream",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue