Files

40 lines
2.7 KiB
SQL
Raw Permalink Normal View History

-- 0006_shop: the shop phase. Label positions for weld and heat tag marks, the page a heat table was copied from
-- on a change order, and the default department checklists as a settings row. Runs as ps_migrate.
-- bfx, bfy: where the label (bubble) of a mark sits, as fractions of the page. fx, fy stay where the arrow points.
-- NULL means the client places the label at the old default offset from the arrow.
ALTER TABLE welds
ADD COLUMN bfx double precision CHECK (bfx >= 0 AND bfx <= 1),
ADD COLUMN bfy double precision CHECK (bfy >= 0 AND bfy <= 1);
ALTER TABLE heat_tags
ADD COLUMN bfx double precision CHECK (bfx >= 0 AND bfx <= 1),
ADD COLUMN bfy double precision CHECK (bfy >= 0 AND bfy <= 1);
-- The page the placement was copied from when a change order replaced the sheet (the old htCarry).
ALTER TABLE heat_table_placements ADD COLUMN carried_from int;
-- The department checklists. {drawing}, {rev} and {wps} are filled in from the packet. The code keeps the same
-- lists as its fallback when this row is missing or does not parse. Admin edits it in phase 9.
INSERT INTO settings (key, value) VALUES ('checklist_templates', '{
"weld": [
{"group": "Before welding", "key": "dwg", "text": "Drawing {drawing} Rev {rev} matches the packet"},
{"group": "Before welding", "key": "heat", "text": "Heat numbers on material match the Materials tab"},
{"group": "Before welding", "key": "wps", "text": "WPS reviewed: {wps}"},
{"group": "Before welding", "key": "fit", "text": "Fit-up and dimensions checked against the drawing"},
{"group": "Before welding", "key": "pre", "text": "Preheat and interpass temperature per WPS"},
{"group": "After welding", "key": "vt", "text": "Visual inspection of all welds acceptable"},
{"group": "After welding", "key": "stamp", "text": "Welds stamped with welder ID"},
{"group": "After welding", "key": "clean", "text": "Slag and spatter removed"},
{"group": "After welding", "key": "qty", "text": "Completed quantity matches each work order"}
],
"plain": [
{"group": "Before starting", "key": "dwg", "text": "Drawing {drawing} Rev {rev} matches the packet"},
{"group": "Before starting", "key": "prev", "text": "Previous department''s work complete and released"},
{"group": "Before starting", "key": "mat", "text": "Material and parts on hand match the packet"},
{"group": "When done", "key": "work", "text": "Work completed per drawing and procedure"},
{"group": "When done", "key": "insp", "text": "Self-inspection done; no damage to finished surfaces"},
{"group": "When done", "key": "qty", "text": "Completed quantity matches each work order"}
]
}'::jsonb) ON CONFLICT (key) DO NOTHING;