@@ -2,7 +2,8 @@ import re
registered = []
-module_name_regex = re.compile('^.*m_([0-9]+)_([a-z_]+)')
+module_name_regex = re.compile("^.*m_([0-9]+)_([a-z_]+)")
+
class Migration:
def __init__(self, version, name, method):
@@ -13,6 +14,7 @@ class Migration:
def run(self, db):
self.method(db)
def migration(method):
match = module_name_regex.match(method.__module__)
if not match:
@@ -1,5 +1,6 @@
import typing
class SqliteMigrator:
def __init__(self, db: typing.Any):
pass
@@ -21,6 +21,7 @@ def run(c, port=8080, host="127.0.0.1"):
},
)
@task
def migrate(c, port=8080, host="127.0.0.1"):
"""Run migrations to update the database schema"""
@@ -34,6 +35,7 @@ def migrate(c, port=8080, host="127.0.0.1"):
def install(c):
"""Install the listed dependencies into a virtualenv"""