beteran-api-kgon-server-ser.../migrations/202208101000_api_kgon_betting_history/up.sql
2022-08-31 08:56:37 +00:00

33 lines
1.3 KiB
SQL

CREATE TABLE IF NOT EXISTS api_kgon_betting_history (
id TEXT NOT NULL,
vendor_id BIGINT NOT NULL,
vendor_name TEXT NOT NULL,
game_id BIGINT NOT NULL,
game_name TEXT NOT NULL,
game_category TEXT NOT NULL,
game_type TEXT NOT NULL,
currency TEXT NOT NULL,
cash DOUBLE PRECISION,
before_cash DOUBLE PRECISION,
after_cash DOUBLE PRECISION,
key TEXT NOT NULL,
ref_id TEXT NOT NULL,
o_ref_id TEXT NOT NULL,
group_key TEXT,
is_bonus BOOLEAN NOT NULL,
is_promo BOOLEAN NOT NULL,
is_jackpot BOOLEAN NOT NULL,
site_username TEXT NOT NULL,
betting_type TEXT NOT NULL,
category TEXT NOT NULL,
created_at BIGINT NOT NULL,
utc_created_at BIGINT NOT NULL,
PRIMARY KEY (id)
);
CREATE INDEX idx_api_kgon_betting_history_vendor_id ON api_kgon_betting_history (vendor_id);
CREATE INDEX idx_api_kgon_betting_history_game_id ON api_kgon_betting_history (game_id);
CREATE INDEX idx_api_kgon_betting_history_created_at ON api_kgon_betting_history (created_at);
CREATE INDEX idx_api_kgon_betting_history_utc_created_at ON api_kgon_betting_history (utc_created_at);
CREATE INDEX idx_api_kgon_betting_history_site_username ON api_kgon_betting_history (site_username);