]> git.xonotic.org Git - xonotic/xonstatdb.git/blob - tables/player_ladder_ranks.tab
ec8b1a0d6eae5f362679c0126da88cd237e0b295
[xonotic/xonstatdb.git] / tables / player_ladder_ranks.tab
1 CREATE TABLE xonstat.player_ladder_ranks
2 (
3   player_ladder_rank_id serial NOT NULL,
4   player_id integer NOT NULL,
5   ladder_cd integer NOT NULL,
6   points integer NOT NULL default 0,
7   rank integer NOT NULL default 1,
8   games integer NOT NULL default 0,
9   wins integer NOT NULL default 0,
10   active_ind boolean NOT NULL default true,
11   create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC'),
12   CONSTRAINT player_ladder_ranks_pk PRIMARY KEY (player_ladder_rank_id),
13   CONSTRAINT player_ladder_ranks_uk01 UNIQUE (player_id, ladder_cd),
14   CONSTRAINT player_ladder_ranks_fk01 FOREIGN KEY (player_id)
15       REFERENCES xonstat.players (player_id) MATCH SIMPLE
16       ON UPDATE NO ACTION ON DELETE NO ACTION,
17   CONSTRAINT player_ladder_ranks_fk02 FOREIGN KEY (ladder_cd)
18       REFERENCES xonstat.cd_ladder (ladder_cd) MATCH SIMPLE
19       ON UPDATE NO ACTION ON DELETE NO ACTION
20 )
21 WITH (
22   OIDS=FALSE
23 );
24 ALTER TABLE xonstat.player_ladder_ranks OWNER TO xonstat;