]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blobdiff - build/build_full.sql
Add rank history table.
[xonotic/xonstatdb.git] / build / build_full.sql
old mode 100644 (file)
new mode 100755 (executable)
index f9be969..0e7a848
@@ -1,36 +1,42 @@
 -- drop tables first in reverse order
+drop table if exists player_ranks cascade;
+drop table if exists player_elos cascade;
+drop table if exists player_nicks cascade;
 drop table if exists db_version cascade;
 drop table if exists hashkeys cascade;
 drop table if exists player_weapon_stats cascade;
 drop table if exists achievements cascade;
 drop table if exists cd_achievement cascade;
-drop table if exists game_mutators cascade;
+--drop table if exists game_mutators cascade;
 drop table if exists player_game_stats cascade;
 drop table if exists games cascade;
-drop table if exists map_game_types cascade;
+--drop table if exists map_game_types cascade;
 drop table if exists maps cascade;
 drop table if exists servers cascade;
 drop table if exists cd_game_type cascade;
 drop table if exists cd_weapon cascade;
-drop table if exists cd_mutator cascade;
+--drop table if exists cd_mutator cascade;
 drop table if exists players cascade;
 
 -- table definitions
 \i tables/players.tab
-\i tables/cd_mutator.tab
+--\i tables/cd_mutator.tab
 \i tables/cd_game_type.tab
 \i tables/cd_weapon.tab
 \i tables/servers.tab
 \i tables/maps.tab
-\i tables/map_game_types.tab
+--\i tables/map_game_types.tab
 \i tables/games.tab
 \i tables/player_game_stats.tab
-\i tables/game_mutators.tab
+--\i tables/game_mutators.tab
 \i tables/cd_achievement.tab
 \i tables/achievements.tab
 \i tables/player_weapon_stats.tab
 \i tables/hashkeys.tab
 \i tables/db_version.tab
+\i tables/player_nicks.tab
+\i tables/player_elos.tab
+\i tables/player_ranks.tab
 
 begin;
 
@@ -67,25 +73,27 @@ insert into cd_game_type(game_type_cd, descr)
 values('rune', 'Runematch');
 insert into cd_game_type(game_type_cd, descr)
 values('tdm', 'Team Deathmatch');
+insert into cd_game_type(game_type_cd, descr)
+values('duel', 'Duel');
 
 -- weapons
 insert into cd_weapon(weapon_cd, descr) values('laser', 'Laser');
 insert into cd_weapon(weapon_cd, descr) values('shotgun', 'Shotgun');
 insert into cd_weapon(weapon_cd, descr) values('uzi', 'Machine Gun');
-insert into cd_weapon(weapon_cd, descr) values('gl', 'Mortar');
+insert into cd_weapon(weapon_cd, descr) values('grenadelauncher', 'Mortar');
 insert into cd_weapon(weapon_cd, descr) values('electro', 'Electro');
 insert into cd_weapon(weapon_cd, descr) values('crylink', 'Crylink');
 insert into cd_weapon(weapon_cd, descr) values('nex', 'Nex');
 insert into cd_weapon(weapon_cd, descr) values('hagar', 'Hagar');
-insert into cd_weapon(weapon_cd, descr) values('rl', 'Rocket Launcher');
+insert into cd_weapon(weapon_cd, descr) values('rocketlauncher', 'Rocket Launcher');
 insert into cd_weapon(weapon_cd, descr) values('minstanex', 'MinstaNex');
-insert into cd_weapon(weapon_cd, descr) values('campingrifle', 'Camping Rifle');
+insert into cd_weapon(weapon_cd, descr) values('rifle', 'Camping Rifle');
 insert into cd_weapon(weapon_cd, descr) values('fireball', 'Fireball');
 insert into cd_weapon(weapon_cd, descr) values('minelayer', 'Minelayer');
 insert into cd_weapon(weapon_cd, descr) values('seeker', 'T.A.G. Seeker');
 insert into cd_weapon(weapon_cd, descr) values('tuba', '@!#%''n Tuba');
 insert into cd_weapon(weapon_cd, descr) values('hlac', 'Heavy Laser Assault Cannon');
-insert into cd_weapon(weapon_cd, descr) values('hookgun', 'Grappling Hook');
+insert into cd_weapon(weapon_cd, descr) values('hook', 'Grappling Hook');
 insert into cd_weapon(weapon_cd, descr) values('porto', 'Port-O-Launch');
 
 -- achievements
@@ -131,41 +139,46 @@ insert into cd_achievement(achievement_cd, descr, active_ind)
 values(20,'Be the highest scorer in a game.', 'Y');
 
 -- mutators
-insert into cd_mutator(mutator_cd, name)
-values(1, 'g_dodging');
-insert into cd_mutator(mutator_cd, name)
-values(2, 'g_minstagib');
-insert into cd_mutator(mutator_cd, name)
-values(3, 'g_nix');
-insert into cd_mutator(mutator_cd, name)
-values(4, 'g_rocket_flying');
-insert into cd_mutator(mutator_cd, name)
-values(5, 'g_weaponarena');
-insert into cd_mutator(mutator_cd, name)
-values(6, 'g_start_weapon_laser');
-insert into cd_mutator(mutator_cd, name)
-values(7, 'sv_gravity');
-insert into cd_mutator(mutator_cd, name)
-values(8, 'g_cloaked');
-insert into cd_mutator(mutator_cd, name)
-values(9, 'g_grappling_hook');
-insert into cd_mutator(mutator_cd, name)
-values(10, 'g_midair');
-insert into cd_mutator(mutator_cd, name)
-values(11, 'g_vampire');
-insert into cd_mutator(mutator_cd, name)
-values(12, 'g_pinata');
-insert into cd_mutator(mutator_cd, name)
-values(13, 'g_weapon_stay');
-insert into cd_mutator(mutator_cd, name)
-values(14, 'g_bloodloss');
-insert into cd_mutator(mutator_cd, name)
-values(15, 'g_jetpack');
+--insert into cd_mutator(mutator_cd, name)
+--values(1, 'g_dodging');
+--insert into cd_mutator(mutator_cd, name)
+--values(2, 'g_minstagib');
+--insert into cd_mutator(mutator_cd, name)
+--values(3, 'g_nix');
+--insert into cd_mutator(mutator_cd, name)
+--values(4, 'g_rocket_flying');
+--insert into cd_mutator(mutator_cd, name)
+--values(5, 'g_weaponarena');
+--insert into cd_mutator(mutator_cd, name)
+--values(6, 'g_start_weapon_laser');
+--insert into cd_mutator(mutator_cd, name)
+--values(7, 'sv_gravity');
+--insert into cd_mutator(mutator_cd, name)
+--values(8, 'g_cloaked');
+--insert into cd_mutator(mutator_cd, name)
+--values(9, 'g_grappling_hook');
+--insert into cd_mutator(mutator_cd, name)
+--values(10, 'g_midair');
+--insert into cd_mutator(mutator_cd, name)
+--values(11, 'g_vampire');
+--insert into cd_mutator(mutator_cd, name)
+--values(12, 'g_pinata');
+--insert into cd_mutator(mutator_cd, name)
+--values(13, 'g_weapon_stay');
+--insert into cd_mutator(mutator_cd, name)
+--values(14, 'g_bloodloss');
+--insert into cd_mutator(mutator_cd, name)
+--values(15, 'g_jetpack');
 
 -- bots and untracked players have special records in player
 insert into players (nick) values ('Bot');
 insert into players (nick) values ('Untracked Player');
 
+-- triggers 
+\i triggers/games_ins_trg.sql
+\i triggers/player_game_stats_ins_trg.sql
+\i triggers/player_weapon_stats_ins_trg.sql
+
 -- version tracking
 insert into db_version(version, descr) values('1.0.0', 'Initial build');