Inject the tables metadata into the upgrade and downgrade functions. Fix a bunch of the downgrades to actually work.
This commit is contained in:
parent
19a589ba54
commit
c7e873366d
15 changed files with 80 additions and 220 deletions
12
util/collections.py
Normal file
12
util/collections.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
class AttrDict(dict):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(AttrDict, self).__init__(*args, **kwargs)
|
||||
self.__dict__ = self
|
||||
|
||||
@classmethod
|
||||
def deep_copy(cls, attr_dict):
|
||||
copy = AttrDict(attr_dict)
|
||||
for key, value in copy.items():
|
||||
if isinstance(value, AttrDict):
|
||||
copy[key] = cls.deep_copy(value)
|
||||
return copy
|
Reference in a new issue