TOURNEY: fix recording of Hands.tourneyId, allow it to be NULL

This commit is contained in:
steffen123 2010-07-15 02:08:59 +02:00
parent 18dc3f29ff
commit d65b6e55c8
3 changed files with 6 additions and 5 deletions

View File

@ -74,7 +74,7 @@ except ImportError:
use_numpy = False use_numpy = False
DB_VERSION = 134 DB_VERSION = 135
# Variance created as sqlite has a bunch of undefined aggregate functions. # Variance created as sqlite has a bunch of undefined aggregate functions.
@ -1562,7 +1562,7 @@ class Database:
p['tableName'], p['tableName'],
p['gameTypeId'], p['gameTypeId'],
p['siteHandNo'], p['siteHandNo'],
0, # tourneyId: 0 means not a tourney hand p['tourneyId'],
p['startTime'], p['startTime'],
datetime.today(), #importtime datetime.today(), #importtime
p['seats'], p['seats'],

View File

@ -103,6 +103,7 @@ class DerivedStats():
self.hands['seats'] = self.countPlayers(hand) self.hands['seats'] = self.countPlayers(hand)
self.hands['maxSeats'] = hand.maxseats self.hands['maxSeats'] = hand.maxseats
self.hands['texture'] = None # No calculation done for this yet. self.hands['texture'] = None # No calculation done for this yet.
self.hands['tourneyId'] = hand.tourneyId
# This (i think...) is correct for both stud and flop games, as hand.board['street'] disappears, and # This (i think...) is correct for both stud and flop games, as hand.board['street'] disappears, and
# those values remain default in stud. # those values remain default in stud.

View File

@ -278,7 +278,7 @@ class Sql:
id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id), id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id),
tableName VARCHAR(22) NOT NULL, tableName VARCHAR(22) NOT NULL,
siteHandNo BIGINT NOT NULL, siteHandNo BIGINT NOT NULL,
tourneyId INT UNSIGNED NOT NULL, tourneyId INT UNSIGNED,
gametypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id), gametypeId SMALLINT UNSIGNED NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
startTime DATETIME NOT NULL, startTime DATETIME NOT NULL,
importTime DATETIME NOT NULL, importTime DATETIME NOT NULL,
@ -315,7 +315,7 @@ class Sql:
id BIGSERIAL, PRIMARY KEY (id), id BIGSERIAL, PRIMARY KEY (id),
tableName VARCHAR(22) NOT NULL, tableName VARCHAR(22) NOT NULL,
siteHandNo BIGINT NOT NULL, siteHandNo BIGINT NOT NULL,
tourneyId INT NOT NULL, tourneyId INT,
gametypeId INT NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id), gametypeId INT NOT NULL, FOREIGN KEY (gametypeId) REFERENCES Gametypes(id),
startTime timestamp without time zone NOT NULL, startTime timestamp without time zone NOT NULL,
importTime timestamp without time zone NOT NULL, importTime timestamp without time zone NOT NULL,
@ -351,7 +351,7 @@ class Sql:
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
tableName TEXT(22) NOT NULL, tableName TEXT(22) NOT NULL,
siteHandNo INT NOT NULL, siteHandNo INT NOT NULL,
tourneyId INT NOT NULL, tourneyId INT,
gametypeId INT NOT NULL, gametypeId INT NOT NULL,
startTime REAL NOT NULL, startTime REAL NOT NULL,
importTime REAL NOT NULL, importTime REAL NOT NULL,