StarsDB: run db correction on startup
This commit is contained in:
@@ -88,9 +88,16 @@ class StarDB():
|
|||||||
);""")
|
);""")
|
||||||
|
|
||||||
self.insertDefaultValues()
|
self.insertDefaultValues()
|
||||||
|
self.dbCorrection()
|
||||||
|
|
||||||
self.connection.commit()
|
self.connection.commit()
|
||||||
|
|
||||||
|
def dbCorrection(self):
|
||||||
|
self.dbCursor.execute("""UPDATE TABLE starInfo
|
||||||
|
SET spType = "-"
|
||||||
|
WHERE spType IS NULL
|
||||||
|
OR length(spType) = 0;""")
|
||||||
|
|
||||||
def insertDefaultValues(self):
|
def insertDefaultValues(self):
|
||||||
sources = ["TESS", "Kepler", "K2"]
|
sources = ["TESS", "Kepler", "K2"]
|
||||||
for s in sources:
|
for s in sources:
|
||||||
|
|||||||
Reference in New Issue
Block a user