See commit comments for version info, see status.txt for status.

Direct suggestions, praise and animal names to steffen@sycamoretest.info or check readme-overview.txt for more contacts

I decided to be generous on the sizes of the types - if computing experience shows one thing then its that it will come back to bite you in the ass if you save 2 bits in the wrong place. If performance and/or db size are too bad we can still shrink some fields.

Relationships are noted in the comment (need to double check that all are listed)

If you want more comments or if anything is confusing or bad let me know.

All money/cash amounts are stored in cents/pennies/whatever (e.g. $4.27 would be stored a 427). Chips are stored as-is (e.g. 3675 chips would be stored as 3675).

Notes on use/editing:

Any change to this must be carried to to the table creation code in fpdb_db.py or at least an entry to known bugs is to be made.

If the code (in particular the importer) and this document disagree then this document is to be considered authorative.

License
Trademarks of third parties have been used under Fair Use or similar laws.
Copyright 2008 Steffen Jobbagy-Felso
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 as published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found in fdl-1.2.txt
The program itself is licensed under AGPLv3, see agpl-3.0.txt

See readme.txt for copying

Table Settings

Field name

Type

Comment

version

smallint

the git version of the database (ie. table design changes and major bugfixes require a bump)

Table Players

Field name

Type

Comment

id

int


name

varchar(32)


siteId

smallint

references Sites.id

comment

text


commentTs

datetime (in UTC)



Table Autorates

An autorating is a computer-"recognised" label/category for a player. Examples could include "Calling Station" if a player has <20% each for aggression and folding postflop. Or "Tight-Aggressive/Aggressive" for players with <20% VPIP, >10% PFR and >40% postflop aggression.

Field name

Type

Comment

id

bigint


playerId

int

references Players.id

gametypeId

smallint

references Gametypes.id

description

varchar(50)

autorating description

shortDesc

char(8)

short description e.g. for display in HUD

ratingTime

datetime (in UTC)

timestamp of rating

handCount

int

number of hands rating is based on


Table Gametypes

Field name

Type

Comment

id

smallint


siteId

smallint

references sites.id

type

char(4)

valid entries:
ring - ringgames aka cash games
tour - tournament incl SnG

base

char(4)

The underlying structure. valid entries:
hold - Holdem and Omaha
stud - Stud and Razz
draw - (incl Badugi)

category

varchar(9)

valid entries:
holdem=Texas Hold'em
omahahi=Omaha High only
omahahilo=Omaha 8 or better
razz=Razz
studhi=7 Card Stud High only
studhilo=7 Card Stud 8 or better
fivedraw=Five Card Draw
27_1draw=2-7 Single Draw
27_3draw=2-7 Tripple Draw
badugi=Badugi

limitType

char(2)

nl=No Limit
cn=Cap No Limit
pl=Pot Limit
cp=Cap Pot Limit
fl=Fixed Limit

hiLo

char(1)

Whether the game is hi, lo or both. Valid Entries:
h - High only
l - Low only
s - Hi/Lo Split

smallBlind

int


bigBlind

int


smallBet

int


bigBet

int



Table Sites

Field name

Type

Comment

id

smallint


name

varchar(32)


currency

char(3)

currency code, e.g. USD, GBP, EUR


Table Hands

Field Name

Type

Comment

id

bigint


tableName

varchar(20)

The site's name for the current table

siteHandNo

bigint

the site's hand number

gametypeId

smallint

references gametypes.id

handStart

datetime (in UTC)

start date&time of the hand

importTime

datetime (in UTC)

date&time of import of this hand

seats

smallint

number of used seats (ie. that got dealt cards)

maxSeats

smallint

number of available seats

comment

text


commentTs

datetime (in UTC)



Table BoardCards

cardX -> can be 1 through 5

Field Name

Type

Comment

id

bigint


handId

bigint

the site's hand number

cardXValue

smallint

2-10=2-10, J=11, Q=12, K=13, A=14 (even in razz), unknown/no card=x, kept=k (draw only)

cardXSuit

char(1)

h=hearts, s=spades, d=diamonds, c=clubs, unknown/no card=x


Table HandsPlayers

cardX: can be 1 through 20, one for each card. In holdem only 1-2 of these are used, in omaha 1-4, in stud/razz 1-7, in single draw games 1-10 is used and in badugi 1-16 (4*4) is used.

For the draw games: the first 5 (badugi: 4) cards are the initial cards, the next 5 (badugi: 4) are after the first draw. If a player keeps some cards then those cards' spaces are filled with "k", short for "kept".
Example 1: If a player gets 2-6 spades for his first five cards and decides to throw away the 4 and then gets a 7 of spades then the first 10 fields of cardXValue would be as follows: 2, 3, 4, 5, 6, k, k, 7, k, k
Example 2: If a player gets 2, 3, 5, 8, J of spades for his first five cards and decides to throw away the 2 and the 3 and then gets a Q and K of spades then the first 10 fields of cardXValue would be as follows: 2, 3, 5, 8, J, Q, K, k, k, k
Note that it will k in the space of which card was there previously, so in example 2 where the player kept the last 3 cards, the last 3 fields of the first draw (ie. card8-10Value) are replaced with k.

I did not separate this into an extra table because I felt the lost space is not sufficiently large. Also the benefit for searching is far less relevant.

Field Name

Type

Comment

id

bigint


handId

bigint

references Hands.id

playerId

int

references Players.id

startCash

int


position

char(1)

BB=B, SB=S, Button=0, Cutoff=1, etc.
This is used in holdem/omaha only.

seatNo

smallint

The seat in which the person was sitting - necessary for HUD

ante

int

note: for cash this could be boolean, but in tourneys you may enter a hand with less than the full ante

cardXValue

smallint

2-10=2-10, J=11, Q=12, K=13, A=14 (even in razz), unknown/no card=x
see note above table

cardXSuit

char(1)

h=hearts, s=spades, d=diamonds, c=clubs, unknown/no card=x

winnings

int

winnings in this hand (bets, antes, etc. are NOT deducted, but rake already is)

rake

int

rake for this player for this hand

comment

text


commentTs

datetime (in UTC)


tourneysPlayersId

bigint

references TourneysPlayers.id


Table HudCache

Field Name

Type

Comment

id

bigint


gametypeId

smallint

references gametypes.id

playerId

int

references players.id

activeSeats

smallint

range 2-10

position

char(1)

Position for which this row applies. In this table this can be B(BB), S(SB), D(Dealer/Button), C(Cutoff), M(Middle - the 3 before cutoff) or E (Early - the 3 before Middle)

tourneyTypeId

smallint

References TourneyTypes.id

HDs

int

number of hands this player played in this gametype with this number of seats

street0VPI

int

number of hands where player paid to see flop
Please note that this already includes street0Aggr!
To calculate limp just deduct street0Aggr from this number

street0Aggr

int

number of hands where player raised before flop

street0_3B4BChance

int

number of hands where player had chance to 3B or 4B

street0_3B4BDone

int

number of hands where player 3bet/4bet before flop

street1Seen

int

number of hands where player saw flop/street4

street2Seen

int

number of hands where player saw turn/street5

street3Seen

int

number of hands where player saw river/street6

street4Seen

int

number of hands where player saw street7

sawShowdown

int

number of hands where player saw showdown

street1Aggr

int

number of hands where player raised flop/street4

street2Aggr

int

number of hands where player raised turn/street5

street3Aggr

int

number of hands where player raised river/street6

street4Aggr

int

number of hands where player raised street7

otherRaisedStreet1

int

number of hands where someone else raised flop/street4

otherRaisedStreet2

int

number of hands where someone else raised turn/street5

otherRaisedStreet3

int

number of hands where someone else raised river/street6

otherRaisedStreet4

int

number of hands where someone else raised street7

foldToOtherRaisedStreet1

int

number of hands where someone else raised flop/street4 and the player folded

foldToOtherRaisedStreet2

int

number of hands where someone else raised Turn/street5 and the player folded

foldToOtherRaisedStreet3

int

number of hands where someone else raised River/street6 and the player folded

foldToOtherRaisedStreet4

int

number of hands where someone else raised street7 and the player folded

wonWhenSeenStreet1

float

How many hands the player won after seeing the flop/street4 - this can be a "partial win" if the pot is split.
To be completely clear, this stores a hand count, NOT a money amount.

wonAtSD

float

As wonWhenSeenStreet1, but for showdown.

stealAttemptChance

int

Player was in CO, BTN or SB and nobody has called yet

stealAttempted

int

Player took a chance per the above condition

foldBbToStealChance

int

Somebody tried to steal BB from player

foldedBbToSteal

int

Player folded BB to steal attempt

foldSbToStealChance

int

Somebody tried to steal SB from player

foldedSbToSteal

int

Player folded SB to steal attempt

street1CBChance

int

Player had chance to make continuation bet on flop/street4

street1CBDone

int

Player used chance to make continuation bet on flop/street4

street2CBChance

int

Player had chance to make continuation bet on turn/street5

street2CBDone

int

Player used chance to make continuation bet on turn/street5

street3CBChance

int

Player had chance to make continuation bet on river/street6

street3CBDone

int

Player used chance to make continuation bet on river/street6

street4CBChance

int

Player had chance to make continuation bet on street7

street4CBDone

int

Player used chance to make continuation bet on street7

foldToStreet1CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet1CBDone

int

Player used chance to fold to continuation bet on this street

foldToStreet2CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet2CBDone

int

Player used chance to fold to continuation bet on this street

foldToStreet3CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet3CBDone

int

Player used chance to fold to continuation bet on this street

foldToStreet4CBChance

int

Player had chance to fold to continuation bet on this street

foldToStreet4CBDone

int

Player used chance to fold to continuation bet on this street

totalProfit

int

how much money in cents the player made

street1CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street1CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street2CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street2CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street3CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street3CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

street4CheckCallRaiseChance

int

How often player had the chance to do a check-raise or a call-raise on this street

street4CheckCallRaiseDone

int

How often player used the chance to do a check-raise or a call-raise on this street

Table HandsActions

Did separate this into an extra table because it makes SELECTing across different streets so much easier. Also the space saving will be very large.

Field Name

Type

Comment

id

bigint


handPlayerId

bigint

references HandsPlayers.id

street

smallint

street number, 0-3 (preflop, flop, turn, river) for holdem/omaha or 0-4 for razz/stud

-1 for seen showdown

actionNo

smallint

action number, this is counted from zero for each street but across all players (e.g. in a heads up where the SB calls and the BB raises and the SB calls again would have numbers 0 and 1 for blinds, 2 and 4 for call and 3 for bet)
Note that the blinds are counted as an action, so if the SB stays in the hand it'll always be action #0

action

char(5)

Bet stands for bring in, complete, bet, double bet, raise and double raise, since they all - technically - do the same thing. Unbet is used for when an uncalled bet is returned, this will have a negative value for amount.

Other valid values: blind call check fold

allIn

boolean

Whether the player went all-in on this action

amount

int

amount put into the middle for this action

comment

text


commentTs

datetime (in UTC)



Tournament Tables


Table Tourneys

Field name

Type

Comment

id

int


tourneyTypeId

smallint

References TourneyTypes.id

siteTourneyNo

bigint


entries

int

-1 if unknown

prizepool

int

Need this as separate field to support rebuy/addon

-1 if unknown

startTime

datetime (in UTC)

Empty if unknown

comment

text


commentTs

datetime (in UTC)



Table TourneyTypes

Field name

Type

Comment

id

int


siteId

smallint

References Sites.id

buyin

int

Buy-in in cents. Without rebuy/add-on

fee

int


knockout

int


rebuyOrAddon

boolean

Whether rebuys or add-ons are possible


Table TourneysPlayers

Field Name

Type

Comment

id

bigint


tourneyId

int

References Tourneys.id

playerId

int

References Players.id

payinAmount

int

Buyin, fee, rebuys and add-ons

rank

int

Finishing rank

winnings

signed int

Winnings (not profit) by this player, -1 if unknown.

comment

text


commentTs

datetime (in UTC)