Fix MySQL 'ADD INDEX' syntax, add functions to create_tables
This commit is contained in:
parent
165ca5bf19
commit
1f7f3f7187
|
@ -574,26 +574,26 @@ class FpdbSQLQueries:
|
||||||
self.query['createHudCacheTable'] = """ """
|
self.query['createHudCacheTable'] = """ """
|
||||||
|
|
||||||
if(self.dbname == 'MySQL InnoDB'):
|
if(self.dbname == 'MySQL InnoDB'):
|
||||||
self.query['addTourneyIndex'] = """ALTER TABLE Tourneys ADD INDEX 'siteTourneyNo'('siteTourneyNo')"""
|
self.query['addTourneyIndex'] = """ALTER TABLE Tourneys ADD INDEX siteTourneyNo(siteTourneyNo)"""
|
||||||
elif(self.dbname == 'PostgreSQL'):
|
elif(self.dbname == 'PostgreSQL'):
|
||||||
# FIXME: This query has a different syntax
|
# FIXME: This query has a different syntax
|
||||||
self.query['addTourneyIndex'] = """ALTER TABLE Tourneys ADD INDEX 'siteTourneyNo'('siteTourneyNo')"""
|
self.query['addTourneyIndex'] = """ALTER TABLE Tourneys ADD INDEX siteTourneyNo(siteTourneyNo)"""
|
||||||
elif(self.dbname == 'SQLite'):
|
elif(self.dbname == 'SQLite'):
|
||||||
self.query['addHandsIndex'] = """ """
|
self.query['addHandsIndex'] = """ """
|
||||||
|
|
||||||
if(self.dbname == 'MySQL InnoDB'):
|
if(self.dbname == 'MySQL InnoDB'):
|
||||||
self.query['addHandsIndex'] = """ALTER TABLE Hands ADD INDEX 'siteHandNo'('siteHandNo')"""
|
self.query['addHandsIndex'] = """ALTER TABLE Hands ADD INDEX siteHandNo(siteHandNo)"""
|
||||||
elif(self.dbname == 'PostgreSQL'):
|
elif(self.dbname == 'PostgreSQL'):
|
||||||
# FIXME: This query has a different syntax
|
# FIXME: This query has a different syntax
|
||||||
self.query['addHandsIndex'] = """ALTER TABLE Hands ADD INDEX 'siteHandNo'('siteHandNo')"""
|
self.query['addHandsIndex'] = """ALTER TABLE Hands ADD INDEX siteHandNo(siteHandNo)"""
|
||||||
elif(self.dbname == 'SQLite'):
|
elif(self.dbname == 'SQLite'):
|
||||||
self.query['addHandsIndex'] = """ """
|
self.query['addHandsIndex'] = """ """
|
||||||
|
|
||||||
if(self.dbname == 'MySQL InnoDB'):
|
if(self.dbname == 'MySQL InnoDB'):
|
||||||
self.query['addPlayersIndex'] = """ALTER TABLE Players ADD INDEX 'name'('name')"""
|
self.query['addPlayersIndex'] = """ALTER TABLE Players ADD INDEX name(name)"""
|
||||||
elif(self.dbname == 'PostgreSQL'):
|
elif(self.dbname == 'PostgreSQL'):
|
||||||
# FIXME: This query has a different syntax
|
# FIXME: This query has a different syntax
|
||||||
self.query['addHandsIndex'] = """ALTER TABLE Hands ADD INDEX 'siteHandNo'('siteHandNo')"""
|
self.query['addHandsIndex'] = """ALTER TABLE Hands ADD INDEX siteHandNo(siteHandNo)"""
|
||||||
elif(self.dbname == 'SQLite'):
|
elif(self.dbname == 'SQLite'):
|
||||||
self.query['addHandsIndex'] = """ """
|
self.query['addHandsIndex'] = """ """
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,9 @@ class fpdb_db:
|
||||||
self.cursor.execute(self.sql.query['createHandsPlayersTable'])
|
self.cursor.execute(self.sql.query['createHandsPlayersTable'])
|
||||||
self.cursor.execute(self.sql.query['createHandsActionsTable'])
|
self.cursor.execute(self.sql.query['createHandsActionsTable'])
|
||||||
self.cursor.execute(self.sql.query['createHudCacheTable'])
|
self.cursor.execute(self.sql.query['createHudCacheTable'])
|
||||||
|
self.cursor.execute(self.sql.query['addTourneyIndex'])
|
||||||
|
self.cursor.execute(self.sql.query['addHandsIndex'])
|
||||||
|
self.cursor.execute(self.sql.query['addPlayersIndex'])
|
||||||
self.fillDefaultData()
|
self.fillDefaultData()
|
||||||
self.db.commit()
|
self.db.commit()
|
||||||
#end def disconnect
|
#end def disconnect
|
||||||
|
|
Loading…
Reference in New Issue
Block a user