* Updated the methods, variables, and SQL in Database.py and SQL.py to add Hours to the HudCache.styleKey field
This commit is contained in:
+9
-9
@@ -2047,7 +2047,7 @@ class Sql:
|
||||
# gets a date, would need to use handsplayers (not hudcache) to get exact hand Id
|
||||
if db_server == 'mysql':
|
||||
self.query['get_date_nhands_ago'] = """
|
||||
select concat( 'd', date_format(max(h.startTime), '%Y%m%d') )
|
||||
select concat( 'd', date_format(max(h.startTime), '%Y%m%d%h') )
|
||||
from (select hp.playerId
|
||||
,coalesce(greatest(max(hp.handId)-%s,1),1) as maxminusx
|
||||
from HandsPlayers hp
|
||||
@@ -2059,7 +2059,7 @@ class Sql:
|
||||
"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['get_date_nhands_ago'] = """
|
||||
select 'd' || to_char(max(h3.startTime), 'YYMMDD')
|
||||
select 'd' || to_char(max(h3.startTime), 'YYMMDDHH')
|
||||
from (select hp.playerId
|
||||
,coalesce(greatest(max(hp.handId)-%s,1),1) as maxminusx
|
||||
from HandsPlayers hp
|
||||
@@ -2071,7 +2071,7 @@ class Sql:
|
||||
"""
|
||||
elif db_server == 'sqlite': # untested guess at query:
|
||||
self.query['get_date_nhands_ago'] = """
|
||||
select 'd' || strftime(max(h3.startTime), 'YYMMDD')
|
||||
select 'd' || strftime(max(h3.startTime), 'YYMMDDHH')
|
||||
from (select hp.playerId
|
||||
,coalesce(greatest(max(hp.handId)-%s,1),1) as maxminusx
|
||||
from HandsPlayers hp
|
||||
@@ -3290,7 +3290,7 @@ class Sql:
|
||||
else 'E'
|
||||
end AS hc_position
|
||||
<tourney_select_clause>
|
||||
,date_format(h.startTime, 'd%y%m%d')
|
||||
,date_format(h.startTime, 'd%y%m%d%h')
|
||||
,count(1)
|
||||
,sum(wonWhenSeenStreet1)
|
||||
,sum(wonWhenSeenStreet2)
|
||||
@@ -3379,7 +3379,7 @@ class Sql:
|
||||
,h.seats
|
||||
,hc_position
|
||||
<tourney_group_clause>
|
||||
,date_format(h.startTime, 'd%y%m%d')
|
||||
,date_format(h.startTime, 'd%y%m%d%h')
|
||||
"""
|
||||
elif db_server == 'postgresql':
|
||||
self.query['rebuildHudCache'] = """
|
||||
@@ -3488,7 +3488,7 @@ class Sql:
|
||||
else 'E'
|
||||
end AS hc_position
|
||||
<tourney_select_clause>
|
||||
,'d' || to_char(h.startTime, 'YYMMDD')
|
||||
,'d' || to_char(h.startTime, 'YYMMDDHH')
|
||||
,count(1)
|
||||
,sum(wonWhenSeenStreet1)
|
||||
,sum(wonWhenSeenStreet2)
|
||||
@@ -3577,7 +3577,7 @@ class Sql:
|
||||
,h.seats
|
||||
,hc_position
|
||||
<tourney_group_clause>
|
||||
,to_char(h.startTime, 'YYMMDD')
|
||||
,to_char(h.startTime, 'YYMMDDHH')
|
||||
"""
|
||||
else: # assume sqlite
|
||||
self.query['rebuildHudCache'] = """
|
||||
@@ -3686,7 +3686,7 @@ class Sql:
|
||||
else 'E'
|
||||
end AS hc_position
|
||||
<tourney_select_clause>
|
||||
,'d' || substr(strftime('%Y%m%d', h.startTime),3,7)
|
||||
,'d' || substr(strftime('%Y%m%d%h', h.startTime),3,7)
|
||||
,count(1)
|
||||
,sum(wonWhenSeenStreet1)
|
||||
,sum(wonWhenSeenStreet2)
|
||||
@@ -3775,7 +3775,7 @@ class Sql:
|
||||
,h.seats
|
||||
,hc_position
|
||||
<tourney_group_clause>
|
||||
,'d' || substr(strftime('%Y%m%d', h.startTime),3,7)
|
||||
,'d' || substr(strftime('%Y%m%d%h', h.startTime),3,7)
|
||||
"""
|
||||
|
||||
self.query['insert_hudcache'] = """
|
||||
|
||||
Reference in New Issue
Block a user