This is a global. Probably best to create a `gimme_my_db_you_jerk` function like this:

```
def create_db(app):
    db = SQLAlchemy()
    db.app = app
    db.init_app(app)
    return db
```

Then add the db to the app:

```
    app.db = db
```

And then change all the code to pull the db from the app rather than from this module.