Variables.getReadLock().unlock();
}
}
db.query("DELETE FROM " + OLD_TABLE_NAME + " WHERE value IS NULL");
db.query("DELETE FROM old USING " + OLD_TABLE_NAME + " AS old, " + TABLE_NAME + " AS new WHERE old.name = new.name");
final ResultSet r = db.query("SELECT * FROM " + OLD_TABLE_NAME + " LIMIT 1");
try {
if (r.next()) {// i.e. the old table is not empty
Skript.error("Could not successfully convert & transfer all variables to the new table in the database '" + databaseName + "'. "
+ "Variables that could not be transferred are left in the old table and Skript will reattempt to transfer them whenever it starts until the old table is empty or is manually deleted. "
+ "Please note that variables recreated by scripts will count as converted and will be removed from the old table on the next restart.");