Skip to content

Database ​

MG-Contest uses oxmysql. Import install/mg_contest.sql once before the first start. All tables use InnoDB and utf8mb4.

Tables ​

TableStores
mg_contest_clansClans: name, color, logo, leader, ELO, wins, losses, win streak, kills, deaths, flags, contests played.
mg_contest_clan_membersClan members, their rank and personal stats. Deleted with the clan.
mg_contest_player_statsLifetime stats per character, kept even without a clan.
mg_contest_invitesPending, accepted and declined clan invites.
mg_contest_bansContest bans from the admin panel, with reason and expiry.
mg_contest_historyFinished contests: zone, winner, participants (JSON), duration and MVP.
mg_contest_player_settingsTablet settings: wallpaper and notifications.
mg_contest_battlepass_progressPlayer XP per season.
mg_contest_battlepass_clan_progressClan XP per season.
mg_contest_battlepass_claimsClaimed tiers per player per season.

Players are linked by citizenid. A character can be in one clan at a time. Deleting a clan also deletes its members and invites.

Useful queries ​

sql
SELECT name, elo, wins, losses
FROM mg_contest_clans
ORDER BY elo DESC
LIMIT 10;
sql
UPDATE mg_contest_clans
SET elo = 0, wins = 0, losses = 0, win_streak = 0;
sql
DELETE FROM mg_contest_bans
WHERE expires_at < UNIX_TIMESTAMP();
sql
-- Replace with your current season ID
DELETE FROM mg_contest_battlepass_progress      WHERE season_id <> 'contest_season_2';
DELETE FROM mg_contest_battlepass_clan_progress WHERE season_id <> 'contest_season_2';
DELETE FROM mg_contest_battlepass_claims        WHERE season_id <> 'contest_season_2';

DANGER

Stop the resource and back up your database before running queries that change data.

Uninstalling ​

After a backup, drop the tables if you no longer need the data:

sql
DROP TABLE IF EXISTS
  mg_contest_battlepass_claims,
  mg_contest_battlepass_clan_progress,
  mg_contest_battlepass_progress,
  mg_contest_player_settings,
  mg_contest_history,
  mg_contest_bans,
  mg_contest_invites,
  mg_contest_clan_members,
  mg_contest_player_stats,
  mg_contest_clans;

All MG Development resources are protected. Redistribution is not permitted.