r2875 - commitDeleteFile(): don't forget to call destroyTagsForEntity() (ticket...
[racktables] / upgrade.php
index 38658397b2fb0a9f4ac1700b6de672fe1aa1a33b..f4642168b7fc726b29fc47d6bb0ce7631cfa533a 100644 (file)
@@ -283,6 +283,8 @@ CREATE TABLE `LDAPCache` (
                                $query[] = $dict_query;
                        }
                        $query[] = "INSERT INTO `Config` (varname, varvalue, vartype, emptyok, is_hidden, description) VALUES ('DEFAULT_SNMP_COMMUNITY','public','string','no','no','Default SNMP Community string')";
+                       // wipe irrelevant records (ticket:250)
+                       $query[] = "DELETE FROM TagStorage WHERE entity_realm = 'file' AND entity_id NOT IN (SELECT id FROM File)";
                        $query[] = "UPDATE Config SET varvalue = '0.17.2' WHERE varname = 'DB_VERSION'";
                        break;
                default: