]> de.git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_ranks.tab
Add table definitions.
[xonotic/xonstatdb.git] / tables / player_ranks.tab
1 CREATE TABLE player_ranks
2 (
3   player_id integer NOT NULL,
4   nick character varying(128),
5   game_type_cd character varying(10) NOT NULL,
6   elo numeric NOT NULL,
7   rank integer NOT NULL,
8   create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
9   CONSTRAINT player_ranks_pk PRIMARY KEY (player_id, game_type_cd),
10   CONSTRAINT player_ranks_fk01 FOREIGN KEY (player_id)
11       REFERENCES players (player_id) MATCH SIMPLE
12       ON UPDATE NO ACTION ON DELETE NO ACTION,
13   CONSTRAINT player_ranks_fk02 FOREIGN KEY (game_type_cd)
14       REFERENCES cd_game_type (game_type_cd) MATCH SIMPLE
15       ON UPDATE NO ACTION ON DELETE NO ACTION
16 )
17 WITH (
18   OIDS=FALSE
19 );
20 ALTER TABLE player_ranks OWNER TO xonstat;