Add new missing fields from recent updates

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
This commit is contained in:
Zach Halpern 2019-04-21 23:59:37 -04:00
parent eba5743aa8
commit 2374181fd9

View file

@ -74,15 +74,28 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"boosterV3 TEXT,"
"code TEXT,"
"codeV3 TEXT,"
"isFoilOnly INTEGER NOT NULL DEFAULT 0,"
"isOnlineOnly INTEGER NOT NULL DEFAULT 0,"
"keyruneCode TEXT,"
"mcmName TEXT,"
"mcmId INTEGER,"
"meta TEXT,"
"mtgoCode TEXT,"
"name TEXT,"
"parentCode TEXT,"
"releaseDate TEXT,"
"totalSetSize INTEGER,"
"type TEXT,"
"tcgplayerGroupId INTEGER,"
"isFoilOnly INTEGER NOT NULL DEFAULT 0"
"totalSetSize INTEGER,"
"type TEXT"
")"
)
# Translations for set names
cursor.execute(
"CREATE TABLE `set_translations` ("
"language TEXT,"
"translation TEXT,"
"setCode TEXT"
")"
)
@ -125,16 +138,18 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"hasFoil INTEGER NOT NULL DEFAULT 0,"
"hasNonFoil INTEGER NOT NULL DEFAULT 0,"
"isAlternative INTEGER NOT NULL DEFAULT 0,"
"isFoilOnly INTEGER NOT NULL DEFAULT 0,"
"isOnlineOnly INTEGER NOT NULL DEFAULT 0,"
"isOversized INTEGER NOT NULL DEFAULT 0,"
"isReserved INTEGER NOT NULL DEFAULT 0,"
"starter INTEGER NOT NULL DEFAULT 0,"
"isStarter INTEGER NOT NULL DEFAULT 0,"
"isTimeshifted INTEGER NOT NULL DEFAULT 0,"
"layout TEXT,"
"life TEXT,"
"loyalty TEXT,"
"manaCost TEXT,"
"mcmName TEXT DEFAULT NULL,"
"mcmId INTEGER DEFAULT 0,"
"mcmMetaId INTEGER DEFAULT 0,"
"multiverseId INTEGER,"
"name TEXT,"
"names TEXT,"
@ -143,8 +158,11 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"originalType TEXT,"
"printings TEXT,"
"power TEXT,"
"purchaseUrls TEXT,"
"rarity TEXT,"
"scryfallId TEXT,"
"scryfallOracleId TEXT,"
"scryfallIllustrationId TEXT,"
"setCode TEXT,"
"side TEXT,"
"subtypes TEXT,"
@ -156,6 +174,7 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"type TEXT,"
"types TEXT,"
"uuid TEXT(36) PRIMARY KEY,"
"uuidV421 TEXT,"
"variations TEXT,"
"watermark TEXT"
")"
@ -170,18 +189,22 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"colorIndicator TEXT,"
"colors TEXT,"
"isOnlineOnly INTEGER NOT NULL DEFAULT 0,"
"layout TEXT,"
"loyalty TEXT,"
"name TEXT,"
"number TEXT,"
"power TEXT,"
"reverseRelated TEXT,"
"scryfallId TEXT,"
"scryfallOracleId TEXT,"
"scryfallIllustrationId TEXT,"
"setCode TEXT,"
"side TEXT,"
"text TEXT,"
"toughness TEXT,"
"type TEXT,"
"uuid TEXT,"
"uuidV421 TEXT,"
"watermark TEXT"
")"
)
@ -249,7 +272,7 @@ def handle_set_row_insertion(set_data: Dict[str, Any]) -> Dict[str, Any]:
:param set_data: Data to process
:return: Dictionary ready for insertion
"""
set_skip_keys = ["cards", "tokens"]
set_skip_keys = ["cards", "tokens", "translations"]
set_insert_values = {}
for key, value in set_data.items():