Skip to content

Commit 6998c83

Browse files
committed
Drop name and steamid64 columns
except from ck_players after importing (version 14)
1 parent 8de9336 commit 6998c83

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

addons/sourcemod/scripting/surftimer/db/updater.sp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ void CheckDatabaseForUpdates()
107107
return;
108108
}
109109

110-
LogMessage("Version 14 looks good.");
110+
if (!SQL_FastQuery(g_hDb, "SELECT accountid FROM ck_vipadmins LIMIT 1")) // TODO: Check for name/steamid64 column if exists or no more
111+
{
112+
db_upgradeDatabase(15);
113+
return;
114+
}
115+
116+
LogMessage("Version 15 looks good.");
111117
}
112118
}
113119

@@ -229,6 +235,15 @@ void db_upgradeDatabase(int ver, bool skipErrorCheck = false)
229235
return;
230236
}
231237
}
238+
else if (ver == 15)
239+
{
240+
SQL_FastQuery(g_hDb, "ALTER TABLE ck_bonus DROP COLUMN name;");
241+
SQL_FastQuery(g_hDb, "ALTER TABLE ck_latestrecords DROP COLUMN name;");
242+
SQL_FastQuery(g_hDb, "ALTER TABLE ck_playertimes DROP COLUMN name;");
243+
SQL_FastQuery(g_hDb, "ALTER TABLE ck_prinfo DROP COLUMN name;");
244+
SQL_FastQuery(g_hDb, "ALTER TABLE ck_playerrank DROP COLUMN steamid64;");
245+
SQL_FastQuery(g_hDb, "ALTER TABLE ck_wrcps DROP COLUMN name;");
246+
}
232247

233248
CheckDatabaseForUpdates();
234249
}

0 commit comments

Comments
 (0)