additional db init check
This commit is contained in:
parent
7a2948ef11
commit
20e4a5e0b6
|
@ -14,7 +14,7 @@ class database:
|
|||
"""INSERT INTO "streams" ("id","user","name","url","directory","status","message") VALUES (NULL,NULL,'WCMF Breakroom','http://1681.live.streamtheworld.com/WCMFFMAAC','wcmf-breakroom','0','')""",
|
||||
"""INSERT INTO "times" ("id","streamid","su","m","t","w","r","f","sa","starthour","startmin","endhour","endmin") VALUES (NULL,'1','0','1','1','1','1','1','0','2','0','7','15')"""
|
||||
]
|
||||
if not os.path.exists("db.sqlite") or os.path.getsize("db.sqlite")==0:
|
||||
if not os.path.exists("db.sqlite") or os.path.getsize("db.sqlite")==0: # TODO: query and see if the tables exist instead
|
||||
db = sqlite3.connect("db.sqlite", check_same_thread=False, cached_statements=0, isolation_level=None)
|
||||
cursor = db.cursor()
|
||||
for query in queries:
|
||||
|
|
Loading…
Reference in New Issue