CREATE TABLE si_inspection_types (
	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
	name VARCHAR(255) NOT NULL UNIQUE
) ENGINE=InnoDB;

INSERT INTO si_inspection_types (id, name) VALUES (1, 'Contractor Safety Audit'), (2, 'Ausgrid Safety Audit');

ALTER TABLE si_inspections ADD COLUMN inspection_type_id INT;

UPDATE si_inspections SET inspection_type_id = 1;

ALTER TABLE si_inspections CHANGE inspection_type_id inspection_type_id INT NOT NULL;
ALTER TABLE si_inspections ADD KEY idx_inspection_type_id (inspection_type_id);
ALTER TABLE si_inspections ADD FOREIGN KEY fk_inspection_id (inspection_type_id) REFERENCES si_inspection_types (id);