X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=tables%2Fplayer_weapon_stats.tab;h=60954bbff423ff3014adab4fdb37e418ab8a98c1;hb=75f5b39c54ab9d7a5f118aa4de1c1d0bb76626d1;hp=23d6a64fc0a79ca9f04026ff2123788d1dc6d330;hpb=65db5e252aabb38c6d25fc3dd13df5fec199c5bb;p=xonotic%2Fxonstatdb.git diff --git a/tables/player_weapon_stats.tab b/tables/player_weapon_stats.tab index 23d6a64..60954bb 100644 --- a/tables/player_weapon_stats.tab +++ b/tables/player_weapon_stats.tab @@ -3,13 +3,14 @@ CREATE TABLE xonstat.player_weapon_stats player_weapon_stats_id bigserial NOT NULL, player_id integer NOT NULL, game_id bigint NOT NULL, - weapon_cd character varying(3) NOT NULL, - actual integer NOT NULL, - max integer NOT NULL, - hit integer NOT NULL, - fired integer NOT NULL, - frags integer NOT NULL, - create_dt timestamp without time zone NOT NULL DEFAULT now(), + player_game_stat_id bigint NOT NULL, + weapon_cd character varying(15) NOT NULL, + actual integer NOT NULL default 0, + max integer NOT NULL default 0, + hit integer NOT NULL default 0, + fired integer NOT NULL default 0, + frags integer NOT NULL default 0, + create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'), CONSTRAINT player_weapon_stats_pk PRIMARY KEY (player_weapon_stats_id), CONSTRAINT player_weapon_stats_fk001 FOREIGN KEY (player_id) REFERENCES xonstat.players (player_id) MATCH SIMPLE @@ -20,7 +21,9 @@ CREATE TABLE xonstat.player_weapon_stats CONSTRAINT player_weapon_stats_fk003 FOREIGN KEY (weapon_cd) REFERENCES xonstat.cd_weapon (weapon_cd) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, - CONSTRAINT player_weapon_stats_uk001 UNIQUE (player_id, game_id, weapon_cd) + CONSTRAINT player_weapon_stats_fk004 FOREIGN KEY (player_game_stat_id) + REFERENCES xonstat.player_game_stats (player_game_stat_id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH ( OIDS=FALSE