2008-08-04 05:44:28 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
#Copyright 2008 Steffen Jobbagy-Felso
|
|
|
|
#This program is free software: you can redistribute it and/or modify
|
|
|
|
#it under the terms of the GNU Affero General Public License as published by
|
|
|
|
#the Free Software Foundation, version 3 of the License.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#You should have received a copy of the GNU Affero General Public License
|
|
|
|
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#In the "official" distribution you can find the license in
|
|
|
|
#agpl-3.0.txt in the docs folder of the package.
|
|
|
|
|
|
|
|
import os
|
|
|
|
import fpdb_simple
|
|
|
|
|
|
|
|
class fpdb_db:
|
|
|
|
def __init__(self):
|
|
|
|
"""Simple constructor, doesnt really do anything"""
|
|
|
|
self.db=None
|
|
|
|
self.cursor=None
|
|
|
|
self.MYSQL_INNODB=2
|
|
|
|
self.PGSQL=3
|
2008-09-15 22:31:55 +02:00
|
|
|
self.SQLITE=4
|
2008-08-04 05:44:28 +02:00
|
|
|
#end def __init__
|
|
|
|
|
|
|
|
def connect(self, backend, host, database, user, password):
|
|
|
|
"""Connects a database with the given parameters"""
|
|
|
|
self.backend=backend
|
|
|
|
self.host=host
|
|
|
|
self.database=database
|
|
|
|
self.user=user
|
|
|
|
self.password=password
|
2008-08-04 22:51:32 +02:00
|
|
|
if backend==self.MYSQL_INNODB:
|
2008-08-04 05:44:28 +02:00
|
|
|
import MySQLdb
|
|
|
|
self.db=MySQLdb.connect(host = host, user = user, passwd = password, db = database)
|
|
|
|
elif backend==self.PGSQL:
|
2008-09-15 22:31:55 +02:00
|
|
|
import psycopg2
|
|
|
|
self.db = psycopg2.connect(host = host, user = user, password = password, database = database)
|
2008-08-04 05:44:28 +02:00
|
|
|
else:
|
|
|
|
raise fpdb_simple.FpdbError("unrecognised database backend:"+backend)
|
|
|
|
self.cursor=self.db.cursor()
|
2008-09-01 17:18:01 +02:00
|
|
|
self.wrongDbVersion=False
|
2008-08-13 04:07:44 +02:00
|
|
|
try:
|
2008-08-15 02:45:40 +02:00
|
|
|
self.cursor.execute("SELECT * FROM Settings")
|
2008-08-13 04:07:44 +02:00
|
|
|
settings=self.cursor.fetchone()
|
2008-10-06 05:26:59 +02:00
|
|
|
if settings[0]!=118:
|
2008-08-16 23:03:27 +02:00
|
|
|
print "outdated or too new database version - please recreate tables"
|
2008-09-01 17:18:01 +02:00
|
|
|
self.wrongDbVersion=True
|
2008-08-13 04:07:44 +02:00
|
|
|
except:# _mysql_exceptions.ProgrammingError:
|
|
|
|
print "failed to read settings table - please recreate tables"
|
2008-09-01 17:18:01 +02:00
|
|
|
self.wrongDbVersion=True
|
2008-08-04 05:44:28 +02:00
|
|
|
#end def connect
|
|
|
|
|
|
|
|
def create_table(self, string):
|
|
|
|
"""creates a table for the given string
|
|
|
|
The string should the name of the table followed by the column list
|
|
|
|
in brackets as if it were an SQL command. Do NOT include the "CREATE TABLES"
|
|
|
|
bit at the beginning nor the ";" or ENGINE= at the end"""
|
|
|
|
string="CREATE TABLE "+string
|
|
|
|
if (self.backend==self.MYSQL_INNODB):
|
|
|
|
string+=" ENGINE=INNODB"
|
|
|
|
string+=";"
|
|
|
|
#print "create_table, string:", string
|
|
|
|
self.cursor.execute(string)
|
|
|
|
self.db.commit()
|
|
|
|
#end def create_table
|
|
|
|
|
|
|
|
def disconnect(self, due_to_error=False):
|
|
|
|
"""Disconnects the DB"""
|
|
|
|
if due_to_error:
|
|
|
|
self.db.rollback()
|
|
|
|
else:
|
|
|
|
self.db.commit()
|
|
|
|
self.cursor.close()
|
|
|
|
self.db.close()
|
|
|
|
#end def disconnect
|
|
|
|
|
|
|
|
def reconnect(self, due_to_error=False):
|
|
|
|
"""Reconnects the DB"""
|
2008-08-06 22:09:29 +02:00
|
|
|
#print "started fpdb_db.reconnect"
|
2008-08-04 05:44:28 +02:00
|
|
|
self.disconnect(due_to_error)
|
|
|
|
self.connect(self.backend, self.host, self.database, self.user, self.password)
|
|
|
|
#end def disconnect
|
|
|
|
|
|
|
|
def drop_tables(self):
|
|
|
|
"""Drops the fpdb tables from the current db"""
|
2008-08-15 03:53:37 +02:00
|
|
|
oldDbVersion=0
|
|
|
|
try:
|
|
|
|
self.cursor.execute("SELECT * FROM settings") #for alpha1
|
|
|
|
oldDbVersion=self.cursor.fetchone()[0]
|
|
|
|
except:# _mysql_exceptions.ProgrammingError:
|
|
|
|
pass
|
|
|
|
try:
|
|
|
|
self.cursor.execute("SELECT * FROM Settings")
|
|
|
|
oldDbVersion=self.cursor.fetchone()[0]
|
|
|
|
except:# _mysql_exceptions.ProgrammingError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
if oldDbVersion<=34:
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS settings;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS autorates;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS board_cards;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS hands_actions;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS hands_players;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS hands;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS tourneys_players;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS tourneys;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS players;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS gametypes;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS sites;")
|
2008-08-15 04:32:27 +02:00
|
|
|
|
2008-08-17 14:13:42 +02:00
|
|
|
if oldDbVersion>34 and oldDbVersion<=45:
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
|
|
|
|
|
2008-08-15 04:32:27 +02:00
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Settings;")
|
2008-08-17 14:13:42 +02:00
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS HudCache;")
|
2008-08-15 04:32:27 +02:00
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Autorates;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS BoardCards;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS HandsActions;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS HandsPlayers;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Hands;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS TourneysPlayers;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Tourneys;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Players;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Gametypes;")
|
2008-08-18 06:58:41 +02:00
|
|
|
if oldDbVersion>45 and oldDbVersion<=51:
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS TourneysGametypes;")
|
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS TourneyTypes;")
|
2008-08-15 04:32:27 +02:00
|
|
|
self.cursor.execute("DROP TABLE IF EXISTS Sites;")
|
2008-08-15 03:53:37 +02:00
|
|
|
|
2008-08-04 05:44:28 +02:00
|
|
|
self.db.commit()
|
|
|
|
#end def drop_tables
|
|
|
|
|
|
|
|
def get_backend_name(self):
|
|
|
|
"""Returns the name of the currently used backend"""
|
2008-08-15 02:45:40 +02:00
|
|
|
if self.backend==2:
|
2008-08-04 05:44:28 +02:00
|
|
|
return "MySQL InnoDB"
|
|
|
|
elif self.backend==3:
|
|
|
|
return "PostgreSQL"
|
2008-08-15 02:45:40 +02:00
|
|
|
else:
|
|
|
|
raise fpdb_simple.FpdbError("invalid backend")
|
2008-08-04 05:44:28 +02:00
|
|
|
#end def get_backend_name
|
|
|
|
|
|
|
|
def get_db_info(self):
|
|
|
|
return (self.host, self.database, self.user, self.password)
|
|
|
|
#end def get_db_info
|
|
|
|
|
2008-09-24 06:22:17 +02:00
|
|
|
def fillDefaultData(self):
|
2008-10-06 05:26:59 +02:00
|
|
|
self.cursor.execute("INSERT INTO Settings VALUES (118);")
|
2008-09-24 06:22:17 +02:00
|
|
|
self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"Full Tilt Poker\", 'USD');")
|
|
|
|
self.cursor.execute("INSERT INTO Sites VALUES (DEFAULT, \"PokerStars\", 'USD');")
|
|
|
|
self.cursor.execute("INSERT INTO TourneyTypes VALUES (DEFAULT, 1, 0, 0, 0, False);")
|
|
|
|
#end def fillDefaultData
|
|
|
|
|
2008-08-04 05:44:28 +02:00
|
|
|
def recreate_tables(self):
|
|
|
|
"""(Re-)creates the tables of the current DB"""
|
2008-09-15 22:31:55 +02:00
|
|
|
|
|
|
|
if self.backend == 3:
|
|
|
|
# postgresql
|
|
|
|
print "recreating tables in postgres db"
|
|
|
|
schema_file = open('schema.postgres.sql', 'r')
|
|
|
|
schema = schema_file.read()
|
|
|
|
schema_file.close()
|
|
|
|
curse = self.db.cursor()
|
|
|
|
# curse.executemany(schema, [1, 2])
|
|
|
|
for sql in schema.split(';'):
|
|
|
|
sql = sql.rstrip()
|
|
|
|
if sql == '':
|
|
|
|
continue
|
|
|
|
curse.execute(sql)
|
2008-09-24 06:22:17 +02:00
|
|
|
#self.fillDefaultData()
|
2008-09-15 22:31:55 +02:00
|
|
|
self.db.commit()
|
|
|
|
curse.close()
|
|
|
|
return
|
|
|
|
|
2008-08-04 05:44:28 +02:00
|
|
|
self.drop_tables()
|
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""Settings (
|
2008-09-01 18:32:18 +02:00
|
|
|
version SMALLINT NOT NULL)""")
|
2008-08-10 03:52:05 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""Sites (
|
2008-09-01 18:32:18 +02:00
|
|
|
id SMALLINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
name varchar(32) NOT NULL,
|
|
|
|
currency char(3) NOT NULL)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""Gametypes (
|
2008-09-01 18:32:18 +02:00
|
|
|
id SMALLINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
siteId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (siteId) REFERENCES Sites(id),
|
|
|
|
type char(4) NOT NULL,
|
|
|
|
base char(4) NOT NULL,
|
|
|
|
category varchar(9) NOT NULL,
|
|
|
|
limitType char(2) NOT NULL,
|
|
|
|
hiLo char(1) NOT NULL,
|
2008-08-15 02:45:40 +02:00
|
|
|
smallBlind int,
|
|
|
|
bigBlind int,
|
2008-09-01 18:32:18 +02:00
|
|
|
smallBet int NOT NULL,
|
|
|
|
bigBet int NOT NULL)""")
|
|
|
|
#NOT NULL not set for small/bigBlind as they are not existent in all games
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""Players (
|
2008-09-01 18:32:18 +02:00
|
|
|
id INT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
name VARCHAR(32) CHARACTER SET utf8 NOT NULL,
|
|
|
|
siteId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (siteId) REFERENCES Sites(id),
|
2008-08-04 05:44:28 +02:00
|
|
|
comment text,
|
2008-08-15 02:45:40 +02:00
|
|
|
commentTs DATETIME)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""Autorates (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
|
|
|
|
gametypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
|
|
|
|
description varchar(50) NOT NULL,
|
|
|
|
shortDesc char(8) NOT NULL,
|
|
|
|
ratingTime DATETIME NOT NULL,
|
|
|
|
handCount int NOT NULL)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""Hands (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
tableName VARCHAR(20) NOT NULL,
|
|
|
|
siteHandNo BIGINT NOT NULL,
|
|
|
|
gametypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
|
|
|
|
handStart DATETIME NOT NULL,
|
|
|
|
importTime DATETIME NOT NULL,
|
|
|
|
seats SMALLINT NOT NULL,
|
|
|
|
maxSeats SMALLINT NOT NULL,
|
2008-08-17 03:46:23 +02:00
|
|
|
comment TEXT,
|
2008-08-15 02:45:40 +02:00
|
|
|
commentTs DATETIME)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""BoardCards (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
handId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (handId) REFERENCES Hands(id),
|
|
|
|
card1Value smallint NOT NULL,
|
|
|
|
card1Suit char(1) NOT NULL,
|
|
|
|
card2Value smallint NOT NULL,
|
|
|
|
card2Suit char(1) NOT NULL,
|
|
|
|
card3Value smallint NOT NULL,
|
|
|
|
card3Suit char(1) NOT NULL,
|
|
|
|
card4Value smallint NOT NULL,
|
|
|
|
card4Suit char(1) NOT NULL,
|
|
|
|
card5Value smallint NOT NULL,
|
|
|
|
card5Suit char(1) NOT NULL)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-18 06:58:41 +02:00
|
|
|
self.create_table("""TourneyTypes (
|
2008-09-01 18:32:18 +02:00
|
|
|
id SMALLINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
siteId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (siteId) REFERENCES Sites(id),
|
|
|
|
buyin INT NOT NULL,
|
|
|
|
fee INT NOT NULL,
|
|
|
|
knockout INT NOT NULL,
|
|
|
|
rebuyOrAddon BOOLEAN NOT NULL)""")
|
2008-08-15 05:28:51 +02:00
|
|
|
|
|
|
|
self.create_table("""Tourneys (
|
2008-09-01 18:32:18 +02:00
|
|
|
id INT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
tourneyTypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
|
|
|
siteTourneyNo BIGINT NOT NULL,
|
|
|
|
entries INT NOT NULL,
|
|
|
|
prizepool INT NOT NULL,
|
|
|
|
startTime DATETIME NOT NULL,
|
2008-08-04 05:44:28 +02:00
|
|
|
comment TEXT,
|
2008-08-15 02:45:40 +02:00
|
|
|
commentTs DATETIME)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""TourneysPlayers (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
tourneyId INT UNSIGNED NOT NULL, FOREIGN KEY (tourneyId) REFERENCES Tourneys(id),
|
|
|
|
playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
|
|
|
|
payinAmount INT NOT NULL,
|
|
|
|
rank INT NOT NULL,
|
|
|
|
winnings INT NOT NULL,
|
2008-08-04 05:44:28 +02:00
|
|
|
comment TEXT,
|
2008-08-15 02:45:40 +02:00
|
|
|
commentTs DATETIME)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""HandsPlayers (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
handId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (handId) REFERENCES Hands(id),
|
|
|
|
playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
|
|
|
|
startCash INT NOT NULL,
|
2008-08-17 03:46:23 +02:00
|
|
|
position CHAR(1),
|
2008-09-01 18:32:18 +02:00
|
|
|
seatNo SMALLINT NOT NULL,
|
2008-08-17 03:46:23 +02:00
|
|
|
ante INT,
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
card1Value smallint NOT NULL,
|
|
|
|
card1Suit char(1) NOT NULL,
|
|
|
|
card2Value smallint NOT NULL,
|
|
|
|
card2Suit char(1) NOT NULL,
|
2008-08-15 02:45:40 +02:00
|
|
|
card3Value smallint,
|
|
|
|
card3Suit char(1),
|
|
|
|
card4Value smallint,
|
|
|
|
card4Suit char(1),
|
|
|
|
card5Value smallint,
|
|
|
|
card5Suit char(1),
|
|
|
|
card6Value smallint,
|
|
|
|
card6Suit char(1),
|
|
|
|
card7Value smallint,
|
|
|
|
card7Suit char(1),
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
winnings int NOT NULL,
|
|
|
|
rake int NOT NULL,
|
2008-08-04 05:44:28 +02:00
|
|
|
comment text,
|
2008-08-15 02:45:40 +02:00
|
|
|
commentTs DATETIME,
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
tourneysPlayersId BIGINT UNSIGNED, FOREIGN KEY (tourneysPlayersId) REFERENCES TourneysPlayers(id))""")
|
2008-09-01 18:32:18 +02:00
|
|
|
#NOT NULL not set on cards 3-7 as they dont exist in all games
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-15 02:45:40 +02:00
|
|
|
self.create_table("""HandsActions (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
handPlayerId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (handPlayerId) REFERENCES HandsPlayers(id),
|
|
|
|
street SMALLINT NOT NULL,
|
|
|
|
actionNo SMALLINT NOT NULL,
|
|
|
|
action CHAR(5) NOT NULL,
|
2008-10-06 05:26:59 +02:00
|
|
|
allIn BOOLEAN NOT NULL,
|
2008-09-01 18:32:18 +02:00
|
|
|
amount INT NOT NULL,
|
2008-08-04 05:44:28 +02:00
|
|
|
comment TEXT,
|
2008-08-15 02:45:40 +02:00
|
|
|
commentTs DATETIME)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-08-17 14:13:42 +02:00
|
|
|
self.create_table("""HudCache (
|
2008-09-01 18:32:18 +02:00
|
|
|
id BIGINT UNSIGNED UNIQUE AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
|
|
|
|
gametypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
|
|
|
|
playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
|
|
|
|
activeSeats SMALLINT NOT NULL,
|
2008-08-17 14:13:42 +02:00
|
|
|
position CHAR(1),
|
2008-09-01 18:32:18 +02:00
|
|
|
tourneyTypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (tourneyTypeId) REFERENCES TourneyTypes(id),
|
2008-08-17 14:13:42 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
HDs INT NOT NULL,
|
|
|
|
street0VPI INT NOT NULL,
|
|
|
|
street0Aggr INT NOT NULL,
|
|
|
|
street0_3B4BChance INT NOT NULL,
|
|
|
|
street0_3B4BDone INT NOT NULL,
|
2008-08-23 02:16:35 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
street1Seen INT NOT NULL,
|
|
|
|
street2Seen INT NOT NULL,
|
|
|
|
street3Seen INT NOT NULL,
|
|
|
|
street4Seen INT NOT NULL,
|
|
|
|
sawShowdown INT NOT NULL,
|
2008-08-23 02:16:35 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
street1Aggr INT NOT NULL,
|
|
|
|
street2Aggr INT NOT NULL,
|
|
|
|
street3Aggr INT NOT NULL,
|
|
|
|
street4Aggr INT NOT NULL,
|
2008-08-23 02:16:35 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
otherRaisedStreet1 INT NOT NULL,
|
|
|
|
otherRaisedStreet2 INT NOT NULL,
|
|
|
|
otherRaisedStreet3 INT NOT NULL,
|
|
|
|
otherRaisedStreet4 INT NOT NULL,
|
|
|
|
foldToOtherRaisedStreet1 INT NOT NULL,
|
|
|
|
foldToOtherRaisedStreet2 INT NOT NULL,
|
|
|
|
foldToOtherRaisedStreet3 INT NOT NULL,
|
|
|
|
foldToOtherRaisedStreet4 INT NOT NULL,
|
|
|
|
wonWhenSeenStreet1 FLOAT NOT NULL,
|
|
|
|
wonAtSD FLOAT NOT NULL,
|
2008-08-13 07:50:30 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
stealAttemptChance INT NOT NULL,
|
|
|
|
stealAttempted INT NOT NULL,
|
|
|
|
foldBbToStealChance INT NOT NULL,
|
|
|
|
foldedBbToSteal INT NOT NULL,
|
|
|
|
foldSbToStealChance INT NOT NULL,
|
|
|
|
foldedSbToSteal INT NOT NULL,
|
2008-08-13 07:50:30 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
street1CBChance INT NOT NULL,
|
|
|
|
street1CBDone INT NOT NULL,
|
|
|
|
street2CBChance INT NOT NULL,
|
|
|
|
street2CBDone INT NOT NULL,
|
|
|
|
street3CBChance INT NOT NULL,
|
|
|
|
street3CBDone INT NOT NULL,
|
|
|
|
street4CBChance INT NOT NULL,
|
|
|
|
street4CBDone INT NOT NULL,
|
2008-08-16 23:03:27 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
foldToStreet1CBChance INT NOT NULL,
|
|
|
|
foldToStreet1CBDone INT NOT NULL,
|
|
|
|
foldToStreet2CBChance INT NOT NULL,
|
|
|
|
foldToStreet2CBDone INT NOT NULL,
|
|
|
|
foldToStreet3CBChance INT NOT NULL,
|
|
|
|
foldToStreet3CBDone INT NOT NULL,
|
|
|
|
foldToStreet4CBChance INT NOT NULL,
|
|
|
|
foldToStreet4CBDone INT NOT NULL,
|
2008-08-16 23:03:27 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
totalProfit INT NOT NULL,
|
2008-08-16 23:03:27 +02:00
|
|
|
|
2008-09-01 18:32:18 +02:00
|
|
|
street1CheckCallRaiseChance INT NOT NULL,
|
|
|
|
street1CheckCallRaiseDone INT NOT NULL,
|
|
|
|
street2CheckCallRaiseChance INT NOT NULL,
|
|
|
|
street2CheckCallRaiseDone INT NOT NULL,
|
|
|
|
street3CheckCallRaiseChance INT NOT NULL,
|
|
|
|
street3CheckCallRaiseDone INT NOT NULL,
|
|
|
|
street4CheckCallRaiseChance INT NOT NULL,
|
|
|
|
street4CheckCallRaiseDone INT NOT NULL)""")
|
2008-08-04 05:44:28 +02:00
|
|
|
|
2008-09-24 06:22:17 +02:00
|
|
|
self.fillDefaultData()
|
2008-08-04 05:44:28 +02:00
|
|
|
self.db.commit()
|
|
|
|
print "finished recreating tables"
|
|
|
|
#end def recreate_tables
|
|
|
|
#end class fpdb_db
|