CREATE TABLE "GCW_LEADERBOARD"
(
	"PERIOD" INT,
	"PERIOD_END" INT,
	"LAST_UPDATED" INT,
	CONSTRAINT GCW_LEADERBOARD_PERIOD_KEY PRIMARY KEY (PERIOD),
	CONSTRAINT GCW_LEADERBOARD_PERIOD_END_UQ UNIQUE (PERIOD_END)
);
GRANT SELECT ON GCW_LEADERBOARD TO public;
CREATE TABLE "GCW_LEADERBOARD_ENTRIES"
(
	"ENTRY" INT,
	"PERIOD" INT,
	"TYPE" INT,
	"FACTION" INT,
	"ENTITY" NUMBER(20),
	"SCORE" FLOAT,
	CONSTRAINT GCW_LEADERBOARD_ENTRY_KEY PRIMARY KEY (ENTRY)
);
GRANT SELECT ON GCW_LEADERBOARD_ENTRIES TO public;
CREATE INDEX GCW_LEADERBOARD_PERIOD_IDX ON GCW_LEADERBOARD (PERIOD, PERIOD_END, LAST_UPDATED);
CREATE INDEX GCW_LEADERBOARD_ENTRY_IDX ON GCW_LEADERBOARD_ENTRIES (PERIOD, TYPE, FACTION, ENTITY, SCORE);
CREATE SEQUENCE GCW_LEADERBOARD_PERIOD_SEQ START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE GCW_LEADERBOARD_ENTRY_SEQ START WITH 1 INCREMENT BY 1;
