diff --git a/tools/alpha-db.sqlite3 b/tools/alpha-db.sqlite3 new file mode 100644 index 00000000000..61fd1527711 Binary files /dev/null and b/tools/alpha-db.sqlite3 differ diff --git a/tools/download-database.py b/tools/download-database.py index 0507c856d11..9949db8d0dd 100644 --- a/tools/download-database.py +++ b/tools/download-database.py @@ -17,21 +17,22 @@ def main(): REGION = 'eu-west-1' + database_name = 'alpha' defs = TableDefinitions() - defs.add('hedy-beta-achievements') - defs.add('hedy-beta-adventures') - defs.add('hedy-beta-classes') - defs.add('hedy-beta-class_customizations') - defs.add('hedy-beta-invitations') - defs.add('hedy-beta-parsons') - defs.add('hedy-beta-program-stats') - defs.add('hedy-beta-programs') - defs.add('hedy-beta-public_profiles') - defs.add('hedy-beta-quiz-stats') - defs.add('hedy-beta-quizAnswers') - defs.add('hedy-beta-tokens') - defs.add('hedy-beta-users') + defs.add(f'hedy-{database_name}-achievements') + defs.add(f'hedy-{database_name}-adventures') + defs.add(f'hedy-{database_name}-classes') + defs.add(f'hedy-{database_name}-class_customizations') + defs.add(f'hedy-{database_name}-invitations') + defs.add(f'hedy-{database_name}-parsons') + defs.add(f'hedy-{database_name}-program-stats') + defs.add(f'hedy-{database_name}-programs') + defs.add(f'hedy-{database_name}-public_profiles') + defs.add(f'hedy-{database_name}-quiz-stats') + defs.add(f'hedy-{database_name}-quizAnswers') + defs.add(f'hedy-{database_name}-tokens') + defs.add(f'hedy-{database_name}-users') parser = argparse.ArgumentParser(description='Download DDB into SQLite') subparsers = parser.add_subparsers() @@ -179,7 +180,10 @@ def determine_columns(rows): for key, value in row.items(): existing_col = columns.get(key) if existing_col: - existing_col.widen_type(SqlType.of(value)) + try: + existing_col.widen_type(SqlType.of(value)) + except RuntimeError: + print(f'Issue in widening {existing_col.name}') else: columns[key] = SqlColumn(key, SqlType.of(value)) return list(columns.values())