unify some strings and remove misleading comment
This commit is contained in:
parent
9ce2e8939b
commit
dfd47cfbfb
|
@ -1068,43 +1068,43 @@ class Database:
|
||||||
if cons:
|
if cons:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print _("creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " add foreign key ("
|
c.execute("alter table " + fk['fktab'] + " add foreign key ("
|
||||||
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
|
+ fk['fkcol'] + ") references " + fk['rtab'] + "("
|
||||||
+ fk['rcol'] + ")")
|
+ fk['rcol'] + ")")
|
||||||
except:
|
except:
|
||||||
print _(" create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed: ") + str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
print _("creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
print _("Creating foreign key "), fk['fktab'], fk['fkcol'], "->", fk['rtab'], fk['rcol']
|
||||||
try:
|
try:
|
||||||
c.execute("alter table " + fk['fktab'] + " add constraint "
|
c.execute("alter table " + fk['fktab'] + " add constraint "
|
||||||
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
|
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey'
|
||||||
+ " foreign key (" + fk['fkcol']
|
+ " foreign key (" + fk['fkcol']
|
||||||
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
|
+ ") references " + fk['rtab'] + "(" + fk['rcol'] + ")")
|
||||||
except:
|
except:
|
||||||
print _(" create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed: ") + str(sys.exc_info())
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
for idx in self.indexes[self.backend]:
|
for idx in self.indexes[self.backend]:
|
||||||
if idx['drop'] == 1:
|
if idx['drop'] == 1:
|
||||||
if self.backend == self.MYSQL_INNODB:
|
if self.backend == self.MYSQL_INNODB:
|
||||||
print _("creating mysql index "), idx['tab'], idx['col']
|
print _("Creating mysql index %s %s") % (idx['tab'], idx['col'])
|
||||||
try:
|
try:
|
||||||
s = "alter table %s add index %s(%s)" % (idx['tab'],idx['col'],idx['col'])
|
s = "alter table %s add index %s(%s)" % (idx['tab'],idx['col'],idx['col'])
|
||||||
c.execute(s)
|
c.execute(s)
|
||||||
except:
|
except:
|
||||||
print _(" create foreign key failed: ") + str(sys.exc_info())
|
print _("Create foreign key failed: ") + str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# pass
|
# pass
|
||||||
# mod to use tab_col for index name?
|
# mod to use tab_col for index name?
|
||||||
print _("creating pg index "), idx['tab'], idx['col']
|
print _("Creating pg index "), idx['tab'], idx['col']
|
||||||
try:
|
try:
|
||||||
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
||||||
c.execute(s)
|
c.execute(s)
|
||||||
except:
|
except:
|
||||||
print _(" create index failed: ") + str(sys.exc_info())
|
print _("Create index failed: ") + str(sys.exc_info())
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
@ -1253,7 +1253,7 @@ class Database:
|
||||||
s = "create index %s on %s(%s)" % (idx['col'],idx['tab'],idx['col'])
|
s = "create index %s on %s(%s)" % (idx['col'],idx['tab'],idx['col'])
|
||||||
self.get_cursor().execute(s)
|
self.get_cursor().execute(s)
|
||||||
except:
|
except:
|
||||||
print _(" create index failed: ") + str(sys.exc_info())
|
print _("Create index failed: ") + str(sys.exc_info())
|
||||||
elif self.backend == self.PGSQL:
|
elif self.backend == self.PGSQL:
|
||||||
# mod to use tab_col for index name?
|
# mod to use tab_col for index name?
|
||||||
print _("Creating pgsql index %s %s") %(idx['tab'], idx['col'])
|
print _("Creating pgsql index %s %s") %(idx['tab'], idx['col'])
|
||||||
|
@ -1262,7 +1262,7 @@ class Database:
|
||||||
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
s = "create index %s_%s_idx on %s(%s)" % (idx['tab'], idx['col'], idx['tab'], idx['col'])
|
||||||
self.get_cursor().execute(s)
|
self.get_cursor().execute(s)
|
||||||
except:
|
except:
|
||||||
print _(" create index failed: ") + str(sys.exc_info())
|
print _("Create index failed: ") + str(sys.exc_info())
|
||||||
elif self.backend == self.SQLITE:
|
elif self.backend == self.SQLITE:
|
||||||
print _("Creating sqlite index %s %s") %(idx['tab'], idx['col'])
|
print _("Creating sqlite index %s %s") %(idx['tab'], idx['col'])
|
||||||
log.debug(_("Creating sqlite index %s %s") %(idx['tab'], idx['col']))
|
log.debug(_("Creating sqlite index %s %s") %(idx['tab'], idx['col']))
|
||||||
|
@ -1278,7 +1278,7 @@ class Database:
|
||||||
self.connection.set_isolation_level(1) # go back to normal isolation level
|
self.connection.set_isolation_level(1) # go back to normal isolation level
|
||||||
except:
|
except:
|
||||||
print _("Error creating indexes: ") + str(sys.exc_value)
|
print _("Error creating indexes: ") + str(sys.exc_value)
|
||||||
raise FpdbError( "Error creating indexes " + str(sys.exc_value) )
|
raise FpdbError("Error creating indexes: " + str(sys.exc_value) )
|
||||||
#end def createAllIndexes
|
#end def createAllIndexes
|
||||||
|
|
||||||
def dropAllIndexes(self):
|
def dropAllIndexes(self):
|
||||||
|
|
|
@ -3055,8 +3055,6 @@ class Sql:
|
||||||
order by stats.category, stats.limitType, stats.bigBlindDesc desc
|
order by stats.category, stats.limitType, stats.bigBlindDesc desc
|
||||||
<orderbyseats>, cast(stats.PlPosition as smallint)
|
<orderbyseats>, cast(stats.PlPosition as smallint)
|
||||||
"""
|
"""
|
||||||
#elif db_server == 'sqlite':
|
|
||||||
# self.query['playerStatsByPosition'] = """ """
|
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# Cash Game Graph query
|
# Cash Game Graph query
|
||||||
|
|
Loading…
Reference in New Issue
Block a user