-- 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;
\i tables/player_weapon_stats.tab
\i tables/hashkeys.tab
\i tables/db_version.tab
+\i tables/player_nicks.tab
begin;
--- /dev/null
+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;