]> de.git.xonotic.org Git - xonotic/xonstatdb.git/commitdiff
Add nick history table.
authorantzucaro <azucaro@gmail.com>
Mon, 10 Oct 2011 19:13:35 +0000 (15:13 -0400)
committerantzucaro <azucaro@gmail.com>
Mon, 10 Oct 2011 19:13:35 +0000 (15:13 -0400)
build/build_full.sql
tables/player_nicks.tab [new file with mode: 0644]

index 43ab506b126fb38c9c08f99f48e18a811ff7a9e8..5ee1362ffd76f4b5277a2a8b770a4ffe3afc04f4 100755 (executable)
@@ -1,4 +1,5 @@
 -- drop tables first in reverse order
 -- drop tables first in reverse order
+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 db_version cascade;
 drop table if exists hashkeys cascade;
 drop table if exists player_weapon_stats cascade;
@@ -31,6 +32,7 @@ drop table if exists players cascade;
 \i tables/player_weapon_stats.tab
 \i tables/hashkeys.tab
 \i tables/db_version.tab
 \i tables/player_weapon_stats.tab
 \i tables/hashkeys.tab
 \i tables/db_version.tab
+\i tables/player_nicks.tab
 
 begin;
 
 
 begin;
 
diff --git a/tables/player_nicks.tab b/tables/player_nicks.tab
new file mode 100644 (file)
index 0000000..7e7ed6f
--- /dev/null
@@ -0,0 +1,15 @@
+CREATE TABLE xonstat.player_nicks
+(
+  player_id integer NOT NULL,
+  stripped_nick character varying(64) NOT NULL,
+  nick character varying(64) NOT NULL,
+  create_dt timestamp without time zone NOT NULL DEFAULT now(),
+  CONSTRAINT player_nicks_pk PRIMARY KEY (player_id, stripped_nick),
+  CONSTRAINT player_nicks_fk01 FOREIGN KEY (player_id)
+      REFERENCES xonstat.players (player_id) MATCH SIMPLE
+      ON UPDATE NO ACTION ON DELETE NO ACTION
+)
+WITH (
+  OIDS=FALSE
+);
+ALTER TABLE xonstat.player_nicks OWNER TO xonstat;