git37 - make table drops depending on previous db version

This commit is contained in:
steffen123 2008-08-15 02:53:37 +01:00
parent ff2e75cb6b
commit 732edf9e69
3 changed files with 43 additions and 30 deletions

View File

@ -3,9 +3,8 @@ Everything is subject to change and especially the order will often change. Patc
alpha2 (release by 17Aug) alpha2 (release by 17Aug)
====== ======
make table drops depending on previous db version make HudData tables positional
move version into seperate file for fpdb gui and db move version into seperate file for fpdb gui and db
printhand each and the 2/3 relevant printplayerflags respectively on ps-lhe-ring-successful-steal-by-cutoff.txt and ps-lhe-ring-call-3B-preflop-cb-no2b.txt
auto-import auto-import
seperate and improve instructions for update seperate and improve instructions for update
verify link in release notes verify link in release notes
@ -18,6 +17,8 @@ update abbreviations.txt
fix up bg colours in tv fix up bg colours in tv
ebuild: symlink doesnt work, USE gtk, more automation, update install-in-gentoo.txt, set permissions in it, copy docs to correct place, use games eclass or whatever to get games group notice, print notice about install-in-gentoo.txt and mysql --config ebuild: symlink doesnt work, USE gtk, more automation, update install-in-gentoo.txt, set permissions in it, copy docs to correct place, use games eclass or whatever to get games group notice, print notice about install-in-gentoo.txt and mysql --config
printhand each and the 2/3 relevant printplayerflags respectively on ps-lhe-ring-successful-steal-by-cutoff.txt and ps-lhe-ring-call-3B-preflop-cb-no2b.txt
alpha3 alpha3
====== ======
check-raise/call-raise on all streets check-raise/call-raise on all streets
@ -91,7 +92,6 @@ recognise somewhere if a file is still active and if so keep it open and only re
can wait till 1.x can wait till 1.x
================= =================
positional stats in HUD
return full ftp functionality return full ftp functionality
in all importer: stop doing if site=="ftp", make class constants for site_id instead in all importer: stop doing if site=="ftp", make class constants for site_id instead
finish cleaning tabledesign html code finish cleaning tabledesign html code

View File

@ -363,7 +363,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt")
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event) self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy) self.window.connect("destroy", self.destroy)
self.window.set_title("Free Poker DB - version: alpha1+, git36") self.window.set_title("Free Poker DB - version: alpha1+, git37")
self.window.set_border_width(1) self.window.set_border_width(1)
self.window.set_size_request(1020,400) self.window.set_size_request(1020,400)
self.window.set_resizable(True) self.window.set_resizable(True)

View File

@ -86,32 +86,45 @@ class fpdb_db:
def drop_tables(self): def drop_tables(self):
"""Drops the fpdb tables from the current db""" """Drops the fpdb tables from the current db"""
#todo: run the below if current db is git34 or lower oldDbVersion=0
self.cursor.execute("DROP TABLE IF EXISTS settings;") try:
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;") self.cursor.execute("SELECT * FROM settings") #for alpha1
self.cursor.execute("DROP TABLE IF EXISTS autorates;") oldDbVersion=self.cursor.fetchone()[0]
self.cursor.execute("DROP TABLE IF EXISTS board_cards;") except:# _mysql_exceptions.ProgrammingError:
self.cursor.execute("DROP TABLE IF EXISTS hands_actions;") pass
self.cursor.execute("DROP TABLE IF EXISTS hands_players;") try:
self.cursor.execute("DROP TABLE IF EXISTS hands;") self.cursor.execute("SELECT * FROM Settings")
self.cursor.execute("DROP TABLE IF EXISTS tourneys_players;") oldDbVersion=self.cursor.fetchone()[0]
self.cursor.execute("DROP TABLE IF EXISTS tourneys;") except:# _mysql_exceptions.ProgrammingError:
self.cursor.execute("DROP TABLE IF EXISTS players;") pass
self.cursor.execute("DROP TABLE IF EXISTS gametypes;")
self.cursor.execute("DROP TABLE IF EXISTS sites;") if oldDbVersion<=34:
self.cursor.execute("DROP TABLE IF EXISTS settings;")
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
self.cursor.execute("DROP TABLE IF EXISTS autorates;")
self.cursor.execute("DROP TABLE IF EXISTS board_cards;")
self.cursor.execute("DROP TABLE IF EXISTS hands_actions;")
self.cursor.execute("DROP TABLE IF EXISTS hands_players;")
self.cursor.execute("DROP TABLE IF EXISTS hands;")
self.cursor.execute("DROP TABLE IF EXISTS tourneys_players;")
self.cursor.execute("DROP TABLE IF EXISTS tourneys;")
self.cursor.execute("DROP TABLE IF EXISTS players;")
self.cursor.execute("DROP TABLE IF EXISTS gametypes;")
self.cursor.execute("DROP TABLE IF EXISTS sites;")
else:
self.cursor.execute("DROP TABLE IF EXISTS Settings;")
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
self.cursor.execute("DROP TABLE IF EXISTS Autorates;")
self.cursor.execute("DROP TABLE IF EXISTS BoardCards;")
self.cursor.execute("DROP TABLE IF EXISTS HandsActions;")
self.cursor.execute("DROP TABLE IF EXISTS HandsPlayers;")
self.cursor.execute("DROP TABLE IF EXISTS Hands;")
self.cursor.execute("DROP TABLE IF EXISTS TourneysPlayers;")
self.cursor.execute("DROP TABLE IF EXISTS Tourneys;")
self.cursor.execute("DROP TABLE IF EXISTS Players;")
self.cursor.execute("DROP TABLE IF EXISTS Gametypes;")
self.cursor.execute("DROP TABLE IF EXISTS Sites;")
self.cursor.execute("DROP TABLE IF EXISTS Settings;")
self.cursor.execute("DROP TABLE IF EXISTS HudDataHoldemOmaha;")
self.cursor.execute("DROP TABLE IF EXISTS Autorates;")
self.cursor.execute("DROP TABLE IF EXISTS BoardCards;")
self.cursor.execute("DROP TABLE IF EXISTS HandsActions;")
self.cursor.execute("DROP TABLE IF EXISTS HandsPlayers;")
self.cursor.execute("DROP TABLE IF EXISTS Hands;")
self.cursor.execute("DROP TABLE IF EXISTS TourneysPlayers;")
self.cursor.execute("DROP TABLE IF EXISTS Tourneys;")
self.cursor.execute("DROP TABLE IF EXISTS Players;")
self.cursor.execute("DROP TABLE IF EXISTS Gametypes;")
self.cursor.execute("DROP TABLE IF EXISTS Sites;")
self.db.commit() self.db.commit()
#end def drop_tables #end def drop_tables