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," "boosterV3 TEXT,"
"code TEXT," "code TEXT,"
"codeV3 TEXT," "codeV3 TEXT,"
"isFoilOnly INTEGER NOT NULL DEFAULT 0,"
"isOnlineOnly INTEGER NOT NULL DEFAULT 0," "isOnlineOnly INTEGER NOT NULL DEFAULT 0,"
"keyruneCode TEXT,"
"mcmName TEXT,"
"mcmId INTEGER,"
"meta TEXT," "meta TEXT,"
"mtgoCode TEXT," "mtgoCode TEXT,"
"name TEXT," "name TEXT,"
"parentCode TEXT,"
"releaseDate TEXT," "releaseDate TEXT,"
"totalSetSize INTEGER,"
"type TEXT,"
"tcgplayerGroupId INTEGER," "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," "hasFoil INTEGER NOT NULL DEFAULT 0,"
"hasNonFoil INTEGER NOT NULL DEFAULT 0," "hasNonFoil INTEGER NOT NULL DEFAULT 0,"
"isAlternative INTEGER NOT NULL DEFAULT 0," "isAlternative INTEGER NOT NULL DEFAULT 0,"
"isFoilOnly INTEGER NOT NULL DEFAULT 0,"
"isOnlineOnly INTEGER NOT NULL DEFAULT 0," "isOnlineOnly INTEGER NOT NULL DEFAULT 0,"
"isOversized INTEGER NOT NULL DEFAULT 0," "isOversized INTEGER NOT NULL DEFAULT 0,"
"isReserved 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," "isTimeshifted INTEGER NOT NULL DEFAULT 0,"
"layout TEXT," "layout TEXT,"
"life TEXT," "life TEXT,"
"loyalty TEXT," "loyalty TEXT,"
"manaCost TEXT," "manaCost TEXT,"
"mcmName TEXT DEFAULT NULL,"
"mcmId INTEGER DEFAULT 0,"
"mcmMetaId INTEGER DEFAULT 0,"
"multiverseId INTEGER," "multiverseId INTEGER,"
"name TEXT," "name TEXT,"
"names TEXT," "names TEXT,"
@ -143,8 +158,11 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"originalType TEXT," "originalType TEXT,"
"printings TEXT," "printings TEXT,"
"power TEXT," "power TEXT,"
"purchaseUrls TEXT,"
"rarity TEXT," "rarity TEXT,"
"scryfallId TEXT," "scryfallId TEXT,"
"scryfallOracleId TEXT,"
"scryfallIllustrationId TEXT,"
"setCode TEXT," "setCode TEXT,"
"side TEXT," "side TEXT,"
"subtypes TEXT," "subtypes TEXT,"
@ -156,6 +174,7 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"type TEXT," "type TEXT,"
"types TEXT," "types TEXT,"
"uuid TEXT(36) PRIMARY KEY," "uuid TEXT(36) PRIMARY KEY,"
"uuidV421 TEXT,"
"variations TEXT," "variations TEXT,"
"watermark TEXT" "watermark TEXT"
")" ")"
@ -170,18 +189,22 @@ def build_sql_schema(sql_connection: sqlite3.Connection) -> None:
"colorIndicator TEXT," "colorIndicator TEXT,"
"colors TEXT," "colors TEXT,"
"isOnlineOnly INTEGER NOT NULL DEFAULT 0," "isOnlineOnly INTEGER NOT NULL DEFAULT 0,"
"layout TEXT,"
"loyalty TEXT," "loyalty TEXT,"
"name TEXT," "name TEXT,"
"number TEXT," "number TEXT,"
"power TEXT," "power TEXT,"
"reverseRelated TEXT," "reverseRelated TEXT,"
"scryfallId TEXT," "scryfallId TEXT,"
"scryfallOracleId TEXT,"
"scryfallIllustrationId TEXT,"
"setCode TEXT," "setCode TEXT,"
"side TEXT," "side TEXT,"
"text TEXT," "text TEXT,"
"toughness TEXT," "toughness TEXT,"
"type TEXT," "type TEXT,"
"uuid TEXT," "uuid TEXT,"
"uuidV421 TEXT,"
"watermark 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 :param set_data: Data to process
:return: Dictionary ready for insertion :return: Dictionary ready for insertion
""" """
set_skip_keys = ["cards", "tokens"] set_skip_keys = ["cards", "tokens", "translations"]
set_insert_values = {} set_insert_values = {}
for key, value in set_data.items(): for key, value in set_data.items():