Merge pull request #60 from mtgjson/booster-patch-1

booster fix
This commit is contained in:
Mark Cheese 2020-07-07 14:55:30 -04:00 committed by GitHub
commit 7a234a725f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -305,6 +305,13 @@ def generate_sql_schema(json_data: Dict,
if setValue not in schema["sets"][setKey]["options"]:
schema["sets"][setKey]["options"].append(setValue)
else:
# handle boosters
if setKey == "boosters":
if engine == "sqlite":
schema["sets"]["booster"] = {"type": "TEXT"}
else:
schema["sets"]["booster"] = {"type": "LONGTEXT"}
continue
# determine type of the set property
if setKey in enums["sets"] and not engine == "sqlite":
schema["sets"][setKey] = {"type": "ENUM", "options": [setValue]}