+ def update_db_to93(self):
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ db[1].execute("\
+ ALTER TABLE timeline ADD epgtitle VARCHAR(100),\
+ ADD epgbtime DATETIME,\
+ ADD epgetime DATETIME,\
+ ADD epgduplicate TINYINT DEFAULT 0,\
+ ADD epgchange TINYINT DEFAULT 0")
+ db[1].execute("\
+ ALTER TABLE in_status ADD version TINYINT")
+ self.close_db(db)
+ self.change_version_in_status("93")
+ def update_db_93to94(self):
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ db[1].execute("\
+ ALTER TABLE timeline ADD counter TINYINT DEFAULT -1")
+ self.close_db(db)
+ self.change_version_in_status("94")
+ def update_db_94to95(self):
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ db[1].execute("\
+ ALTER TABLE timeline ADD epgexp VARCHAR(200)")
+ self.close_db(db)
+ self.change_version_in_status("95")
+ def update_db_95to96(self):
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ self.close_db(db)
+ self.change_version_in_status("96")
+ def update_db_96to98(self):
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ self.close_db(db)
+ self.change_version_in_status("98")
+ def update_db_98to100(self):
+ ###ここで前のepg_chをバックアップしてchtxtの変換をする必要がある。
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ db[1].execute("\
+ UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT(CONCAT(epg_ch.ch,'_'),epg_ch.csch) WHERE NOT (substring(epg_ch.bctype,1,2) = 'bs' OR substring(epg_ch.bctype,1,2) = 'cs')")
+ db[1].execute("\
+ UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('BS_',epg_ch.ch) WHERE substring(epg_ch.bctype,1,2) = 'bs'")
+ db[1].execute("\
+ UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('CS_',epg_ch.csch) WHERE substring(epg_ch.bctype,1,2) = 'cs'")
+ try:
+ db[1].execute("\
+ ALTER TABLE epg_ch DROP ontv")
+ except:
+ ""
+ db[1].execute("\
+ ALTER TABLE epg_ch ADD logo0 BLOB,\
+ ADD logo1 BLOB,\
+ ADD logo2 BLOB,\
+ ADD logo3 BLOB,\
+ ADD logo4 BLOB,\
+ ADD logo5 BLOB\
+ ")
+ db[1].execute("\
+ ALTER TABLE in_auto_jbk_key ADD auto TINYINT DEFAULT 0")
+ db[1].execute("\
+ ALTER TABLE in_auto_jbk_key ADD opt VARCHAR(20) DEFAULT \"\"")
+ self.close_db(db)
+ self.change_installed_in_status()#チャンネルスキャンをさせる
+ self.change_version_in_status("100")
+ def update_db_100to101(self):
+ db = self.connect_db()
+ self.drop_in_settings()
+ self.new_in_settings()
+ self.new_epg_ch()
+ try:
+ db[1].execute("\
+ ALTER TABLE timeline ADD epgcategory VARCHAR(100)\
+ ")
+ except:
+ ""
+ self.close_db(db)
+ #self.change_installed_in_status()#チャンネルスキャンをさせる
+ self.change_version_in_status("101")
\ No newline at end of file