
DROP TABLE hand;
DROP TABLE player;

CREATE TABLE hand (
	hand_id integer NOT NULL,
	timestamp timestamp NOT NULL,
	dealer smallint NOT NULL,
	flop varchar(256),
	turn varchar(256),
	river varchar(256),
	showdown varchar(256),
	card1 char(3),
	card2 char(3),
	card3 char(3),
	card4 char(3),
	card5 char(3),
	PRIMARY KEY (hand_id)
);

CREATE TABLE player (
	hand_id integer NOT NULL,
	account varchar(256) NOT NULL,
	name varchar(256) NOT NULL,
	position smallint NOT NULL,
	flop varchar(256),
	turn varchar(256),
	river varchar(256),
	money_in decimal,
	winnings decimal,
	card1 char(3),
	card2 char(3),
	PRIMARY KEY (hand_id, account, name)
);