]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_elos.tab
Add elo categories to several tables.
[xonotic/xonstatdb.git] / tables / player_elos.tab
1 CREATE TABLE xonstat.player_elos
2 (
3   player_id integer NOT NULL,
4   game_type_cd character varying(10) NOT NULL,
5   category character varying(10) NOT NULL default 'general',
6   games integer NOT NULL default 0,
7   elo numeric NOT NULL,
8   active_ind boolean NOT NULL default true,
9   create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
10   update_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
11   CONSTRAINT player_elos_pk PRIMARY KEY (player_id, game_type_cd, category),
12   CONSTRAINT player_elos_fk01 FOREIGN KEY (player_id)
13       REFERENCES xonstat.players (player_id) MATCH SIMPLE
14       ON UPDATE NO ACTION ON DELETE NO ACTION,
15   CONSTRAINT player_elos_fk02 FOREIGN KEY (game_type_cd)
16       REFERENCES xonstat.cd_game_type (game_type_cd) MATCH SIMPLE
17       ON UPDATE NO ACTION ON DELETE NO ACTION
18 )
19 WITH (
20   OIDS=FALSE
21 );
22 ALTER TABLE xonstat.player_elos OWNER TO xonstat;