diff --git a/tools/download-database.py b/tools/download-database.py index 2a8f51d2183..0507c856d11 100644 --- a/tools/download-database.py +++ b/tools/download-database.py @@ -96,7 +96,13 @@ def insert_table(self, table_name): table.key_columns + [onetomanycol] if listcol.type.is_set else []) print(onetomanytable.table_name) cursor.execute(onetomanytable.drop_statement) - cursor.execute(onetomanytable.create_statement) + try: + # The `classes` table contains a list of objects, which this script can't + # deal with. Catch the error, but continue. + cursor.execute(onetomanytable.create_statement) + except Exception as e: + print(f'Dropping column {listcol.name} (running \'{onetomanytable.create_statement}\' leads to {e})') + continue one_to_many_data = [] for row in table_data['rows']: @@ -110,7 +116,7 @@ def insert_table(self, table_name): # Maps (not implemented yet) for mapcol in (col for col in columns if col.type.is_map): - print(f'Dropping column: {table.original_name}.{mapcol.original_name}') + print(f'Dropping column: {table.original_name}.{mapcol.original_name} (no support for map columns)') self.db.commit()