From d291b8621f9b1145bdd64b19084f92d056bd41ed Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 2 Jul 2010 22:40:40 +0200 Subject: [PATCH] removed TourneysPlayers.payinAmounts --- pyfpdb/AlchemyTables.py | 1 - pyfpdb/Database.py | 2 +- pyfpdb/SQL.py | 11 +++-------- pyfpdb/Tourney.py | 5 +---- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/pyfpdb/AlchemyTables.py b/pyfpdb/AlchemyTables.py index d936ce46..4d222a32 100644 --- a/pyfpdb/AlchemyTables.py +++ b/pyfpdb/AlchemyTables.py @@ -403,7 +403,6 @@ tourneys_players_table = Table('TourneysPlayers', metadata, Column('id', BigIntColumn, primary_key=True), Column('tourneyId', Integer, ForeignKey("Tourneys.id"), nullable=False), Column('playerId', Integer, ForeignKey("Players.id"), nullable=False), - Column('payinAmount', Integer), # INT NOT NULL Column('rank', Integer), # INT NOT NULL Column('winnings', Integer), # INT NOT NULL Column('winningsCurrency', Text), # TEXT diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 86409984..f7bb8a70 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -75,7 +75,7 @@ except ImportError: use_numpy = False -DB_VERSION = 123 +DB_VERSION = 124 # Variance created as sqlite has a bunch of undefined aggregate functions. diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 735135ef..506c0ca6 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -846,7 +846,6 @@ class Sql: id BIGINT UNSIGNED 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, winningsCurrency VARCHAR(4) NOT NULL, @@ -861,7 +860,6 @@ class Sql: id BIGSERIAL, PRIMARY KEY (id), tourneyId INT, FOREIGN KEY (tourneyId) REFERENCES Tourneys(id), playerId INT, FOREIGN KEY (playerId) REFERENCES Players(id), - payinAmount INT, rank INT, winnings INT, winningsCurrency VARCHAR(4), @@ -875,7 +873,6 @@ class Sql: id INT PRIMARY KEY, tourneyId INT, playerId INT, - payinAmount INT, rank INT, winnings INT, winningsCurrency VARCHAR(4), @@ -3658,7 +3655,6 @@ class Sql: """ self.query['getTourneysPlayers'] = """SELECT id, - payinAmount, rank, winnings, winningsCurrency, @@ -3672,8 +3668,7 @@ class Sql: """ self.query['updateTourneysPlayers'] = """UPDATE TourneysPlayers - SET payinAmount = %s, - rank = %s, + SET rank = %s, winnings = %s, winningsCurrency = %s, rebuyCount = %s, @@ -3685,8 +3680,8 @@ class Sql: """ self.query['insertTourneysPlayers'] = """INSERT INTO TourneysPlayers - (tourneyId, playerId, payinAmount, rank, winnings, winningsCurrency, rebuyCount, addOnCount, koCount, comment, commentTs) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) + (tourneyId, playerId, rank, winnings, winningsCurrency, rebuyCount, addOnCount, koCount, comment, commentTs) + VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """ self.query['selectHandsPlayersWithWrongTTypeId'] = """SELECT id diff --git a/pyfpdb/Tourney.py b/pyfpdb/Tourney.py index 245ea697..1624c31a 100644 --- a/pyfpdb/Tourney.py +++ b/pyfpdb/Tourney.py @@ -89,7 +89,6 @@ class Tourney(object): self.finishPositions = {} self.winnings = {} self.winningsCurrency = {} - self.payinAmounts = {} self.rebuyCounts = {} self.addOnCounts = {} self.koCounts = {} @@ -137,7 +136,6 @@ class Tourney(object): structs = ( ("GAMETYPE", self.gametype), ("PLAYERS", self.players), - ("PAYIN AMOUNTS", self.payinAmounts), ("POSITIONS", self.finishPositions), ("WINNINGS", self.winnings), ("COUNT REBUYS", self.rebuyCounts), @@ -194,7 +192,7 @@ class Tourney(object): """ Function to create Tourney object from database """ - def addPlayer(self, rank, name, winnings, winningsCurrency, payinAmount, rebuyCount, addOnCount, koCount): + def addPlayer(self, rank, name, winnings, winningsCurrency, rebuyCount, addOnCount, koCount): """\ Adds a player to the tourney, and initialises data structures indexed by player. rank (int) indicating the finishing rank (can be -1 if unknown) @@ -206,7 +204,6 @@ winnings (decimal) the money the player ended the tourney with (can be 0, or self.finishPositions.update( { name : Decimal(rank) } ) self.winnings.update( { name : Decimal(winnings) } ) self.winningsCurrency.update( { name : winningsCurrency } ) - self.payinAmounts.update( {name : Decimal(payinAmount) } ) self.rebuyCounts.update( {name: Decimal(rebuyCount) } ) self.addOnCounts.update( {name: Decimal(addOnCount) } ) self.koCounts.update( {name : Decimal(koCount) } )