From d1c1a0a0f426481496ae9d662e2745e13d5f00d2 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Wed, 11 Aug 2010 04:43:17 +0200 Subject: [PATCH] correct Backings.tourneysPlayerId to tourneysPlayersId like it's used in HP --- pyfpdb/Database.py | 6 +++--- pyfpdb/SQL.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index f00c35f5..92c30bea 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -74,7 +74,7 @@ except ImportError: use_numpy = False -DB_VERSION = 141 +DB_VERSION = 142 # Variance created as sqlite has a bunch of undefined aggregate functions. @@ -140,7 +140,7 @@ class Database: , {'tab':'TourneysPlayers', 'col':'playerId', 'drop':0} #, {'tab':'TourneysPlayers', 'col':'tourneyId', 'drop':0} unique indexes not dropped , {'tab':'TourneyTypes', 'col':'siteId', 'drop':0} - , {'tab':'Backings', 'col':'tourneysPlayerId', 'drop':0} + , {'tab':'Backings', 'col':'tourneysPlayersId', 'drop':0} , {'tab':'Backings', 'col':'playerId', 'drop':0} ] , [ # indexes for sqlite (list index 4) @@ -155,7 +155,7 @@ class Database: , {'tab':'Tourneys', 'col':'tourneyTypeId', 'drop':1} , {'tab':'TourneysPlayers', 'col':'playerId', 'drop':0} , {'tab':'TourneyTypes', 'col':'siteId', 'drop':0} - , {'tab':'Backings', 'col':'tourneysPlayerId', 'drop':0} + , {'tab':'Backings', 'col':'tourneysPlayersId', 'drop':0} , {'tab':'Backings', 'col':'playerId', 'drop':0} ] ] diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index baf305b2..111cae9f 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -137,21 +137,21 @@ class Sql: if db_server == 'mysql': self.query['createBackingsTable'] = """CREATE TABLE Backings ( id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id), - tourneysPlayerId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id), + tourneysPlayersId BIGINT UNSIGNED NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id), playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id), buyInPercentage FLOAT UNSIGNED NOT NULL, payOffPercentage FLOAT UNSIGNED NOT NULL) ENGINE=INNODB""" elif db_server == 'postgresql': self.query['createBackingsTable'] = """CREATE TABLE Backings ( id BIGSERIAL, PRIMARY KEY (id), - tourneysPlayerId INT NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id), + tourneysPlayersId INT NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id), playerId INT NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id), buyInPercentage FLOAT NOT NULL, payOffPercentage FLOAT NOT NULL)""" elif db_server == 'sqlite': self.query['createBackingsTable'] = """CREATE TABLE Backings ( id INTEGER PRIMARY KEY, - tourneysPlayerId INT NOT NULL, + tourneysPlayersId INT NOT NULL, playerId INT NOT NULL, buyInPercentage REAL UNSIGNED NOT NULL, payOffPercentage REAL UNSIGNED NOT NULL)"""