Make indexes and tables optional

This commit is contained in:
shortcutme 2018-01-19 02:18:40 +01:00
parent 089bb92f70
commit fd451ae766
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -204,10 +204,10 @@ class Db(object):
changed_tables.append("json")
# Check schema tables
for table_name, table_settings in self.schema["tables"].items():
for table_name, table_settings in self.schema.get("tables", {}).items():
changed = cur.needTable(
table_name, table_settings["cols"],
table_settings["indexes"], version=table_settings["schema_changed"]
table_settings.get("indexes", []), version=table_settings.get("schema_changed", 0)
)
if changed:
changed_tables.append(table_name)