'Returns the full path of the migrations directory.
If it doesn\'t exist yet, returns where it would exist, based on the
app\'s migrations module (defaults to app.migrations)'

def migrations_dir(self):

    module_path = self.migrations_module()
    try:
        module = importlib.import_module(module_path)
    except ImportError:
        try:
            parent = importlib.import_module('.'.join(module_path.split('.')[:(-1)]))
        except ImportError:
            raise exceptions.InvalidMigrationModule(application=self.application.__name__, module=module_path)
        else:
            return os.path.join(os.path.dirname(parent.__file__), module_path.split('.')[(-1)])
    else:
        return os.path.dirname(module.__file__)
