|
@@ -14,5 +14,8 @@ class Migration:
|
|
|
self.method(db)
|
|
|
|
|
|
def migration(method):
|
|
|
- version, name = module_name_regex.match(method.__module__).groups()
|
|
|
+ match = module_name_regex.match(method.__module__)
|
|
|
+ if not match:
|
|
|
+ raise Exception(f"Unable to find migration version in #{method.__module__}")
|
|
|
+ version, name = match.groups()
|
|
|
registered.append(Migration(version, name, method))
|