correct Backings.tourneysPlayerId to tourneysPlayersId like it's used in HP

This commit is contained in:
steffen123 2010-08-11 04:43:17 +02:00
parent f1ac0b1dfa
commit d1c1a0a0f4
2 changed files with 6 additions and 6 deletions

View File

@ -74,7 +74,7 @@ except ImportError:
use_numpy = False use_numpy = False
DB_VERSION = 141 DB_VERSION = 142
# Variance created as sqlite has a bunch of undefined aggregate functions. # 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':'playerId', 'drop':0}
#, {'tab':'TourneysPlayers', 'col':'tourneyId', 'drop':0} unique indexes not dropped #, {'tab':'TourneysPlayers', 'col':'tourneyId', 'drop':0} unique indexes not dropped
, {'tab':'TourneyTypes', 'col':'siteId', '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} , {'tab':'Backings', 'col':'playerId', 'drop':0}
] ]
, [ # indexes for sqlite (list index 4) , [ # indexes for sqlite (list index 4)
@ -155,7 +155,7 @@ class Database:
, {'tab':'Tourneys', 'col':'tourneyTypeId', 'drop':1} , {'tab':'Tourneys', 'col':'tourneyTypeId', 'drop':1}
, {'tab':'TourneysPlayers', 'col':'playerId', 'drop':0} , {'tab':'TourneysPlayers', 'col':'playerId', 'drop':0}
, {'tab':'TourneyTypes', 'col':'siteId', '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} , {'tab':'Backings', 'col':'playerId', 'drop':0}
] ]
] ]

View File

@ -137,21 +137,21 @@ class Sql:
if db_server == 'mysql': if db_server == 'mysql':
self.query['createBackingsTable'] = """CREATE TABLE Backings ( self.query['createBackingsTable'] = """CREATE TABLE Backings (
id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, PRIMARY KEY (id), 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), playerId INT UNSIGNED NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
buyInPercentage FLOAT UNSIGNED NOT NULL, buyInPercentage FLOAT UNSIGNED NOT NULL,
payOffPercentage FLOAT UNSIGNED NOT NULL) ENGINE=INNODB""" payOffPercentage FLOAT UNSIGNED NOT NULL) ENGINE=INNODB"""
elif db_server == 'postgresql': elif db_server == 'postgresql':
self.query['createBackingsTable'] = """CREATE TABLE Backings ( self.query['createBackingsTable'] = """CREATE TABLE Backings (
id BIGSERIAL, PRIMARY KEY (id), 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), playerId INT NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id),
buyInPercentage FLOAT NOT NULL, buyInPercentage FLOAT NOT NULL,
payOffPercentage FLOAT NOT NULL)""" payOffPercentage FLOAT NOT NULL)"""
elif db_server == 'sqlite': elif db_server == 'sqlite':
self.query['createBackingsTable'] = """CREATE TABLE Backings ( self.query['createBackingsTable'] = """CREATE TABLE Backings (
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
tourneysPlayerId INT NOT NULL, tourneysPlayersId INT NOT NULL,
playerId INT NOT NULL, playerId INT NOT NULL,
buyInPercentage REAL UNSIGNED NOT NULL, buyInPercentage REAL UNSIGNED NOT NULL,
payOffPercentage REAL UNSIGNED NOT NULL)""" payOffPercentage REAL UNSIGNED NOT NULL)"""