CREATE TABLE rego_inspection_types (
	id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
	name VARCHAR(64) NOT NULL UNIQUE
);

ALTER TABLE assets ADD COLUMN service_interval_months TINYINT DEFAULT 0;

ALTER TABLE assets ADD COLUMN service_interval_km INT DEFAULT 0;

ALTER TABLE assets ADD COLUMN rego_due_date DATE DEFAULT NULL;

ALTER TABLE assets ADD COLUMN rego_inspection_type_id INT DEFAULT NULL;

ALTER TABLE assets ADD KEY idx_rego_inspection_type (rego_inspection_type_id);

ALTER TABLE assets ADD FOREIGN KEY idx_rego_inspection_type (rego_inspection_type_id) REFERENCES rego_inspection_types (id);
