Skip to content

Commit

Permalink
Drop name and steamid64 columns
Browse files Browse the repository at this point in the history
except from ck_players after importing (version 14)
  • Loading branch information
Bara committed Mar 4, 2023
1 parent 8de9336 commit 6998c83
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion addons/sourcemod/scripting/surftimer/db/updater.sp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ void CheckDatabaseForUpdates()
return;
}

LogMessage("Version 14 looks good.");
if (!SQL_FastQuery(g_hDb, "SELECT accountid FROM ck_vipadmins LIMIT 1")) // TODO: Check for name/steamid64 column if exists or no more
{
db_upgradeDatabase(15);
return;
}

LogMessage("Version 15 looks good.");
}
}

Expand Down Expand Up @@ -229,6 +235,15 @@ void db_upgradeDatabase(int ver, bool skipErrorCheck = false)
return;
}
}
else if (ver == 15)
{
SQL_FastQuery(g_hDb, "ALTER TABLE ck_bonus DROP COLUMN name;");
SQL_FastQuery(g_hDb, "ALTER TABLE ck_latestrecords DROP COLUMN name;");
SQL_FastQuery(g_hDb, "ALTER TABLE ck_playertimes DROP COLUMN name;");
SQL_FastQuery(g_hDb, "ALTER TABLE ck_prinfo DROP COLUMN name;");
SQL_FastQuery(g_hDb, "ALTER TABLE ck_playerrank DROP COLUMN steamid64;");
SQL_FastQuery(g_hDb, "ALTER TABLE ck_wrcps DROP COLUMN name;");
}

CheckDatabaseForUpdates();
}
Expand Down

0 comments on commit 6998c83

Please sign in to comment.