0; }; if (!$itflow_has('column', 'unit_slots')) { mysqli_query($mysqli, "ALTER TABLE `rack_units` ADD `unit_slots` int(11) NOT NULL DEFAULT 0 AFTER `unit_notes`"); } if (!$itflow_has('column', 'unit_position')) { mysqli_query($mysqli, "ALTER TABLE `rack_units` ADD `unit_position` int(11) NOT NULL DEFAULT 0 AFTER `unit_slots`"); } if (!$itflow_has('column', 'unit_parent_id')) { mysqli_query($mysqli, "ALTER TABLE `rack_units` ADD `unit_parent_id` int(11) DEFAULT NULL AFTER `unit_rack_id`"); } if (!$itflow_has('key', 'unit_parent_id')) { mysqli_query($mysqli, "ALTER TABLE `rack_units` ADD KEY `unit_parent_id` (`unit_parent_id`)"); } if (!$itflow_has('constraint', 'rack_units_ibfk_2')) { mysqli_query($mysqli, "ALTER TABLE `rack_units` ADD CONSTRAINT `rack_units_ibfk_2` FOREIGN KEY (`unit_parent_id`) REFERENCES `rack_units` (`unit_id`) ON DELETE CASCADE"); } unset($itflow_has);