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:
Daniel Roth 2026-07-21 17:26:37 +01:00 committed by GitHub
commit 7e54e64125
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13155 additions and 0 deletions

View file

@ -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
);

File diff suppressed because it is too large Load diff

View file

@ -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
}
]
}