appnexus / schema-tool

framework-agnostic, schema management tool for everyone
Other
40 stars 21 forks source link

Stacktrace when unpacking too many alters in schema history #89

Open dtrupenn opened 5 years ago

dtrupenn commented 5 years ago

I've ran into a ValueError issue when attempting to run schema up on a database with too many alters applied. The for loop iterator attempting to check each alter_id errors out when the dict object is too large to iterate. The proposal here is to update these for loops on these dicts to utilize iteritems() (items() for python3) to get around the ValueError.

StackTrace:

Traceback (most recent call last):
  File "/usr/bin/schema", line 95, in main
    globals()[handler](context).run()
  File "/usr/local/adnxs/schema-tool/schematool/command/up.py", line 67, in run
    for (_, alter_id, _) in history:
ValueError: too many values to unpack