feat(db): Add migrations support to plugins

This commit is contained in:
Ferdinand Thiessen 2021-12-19 22:22:05 +01:00
parent e5b4150ce3
commit 77be01b8cf
2 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@
Extends users plugin with balance functions
"""
import pathlib
from flask import Blueprint, current_app
from werkzeug.local import LocalProxy
from werkzeug.exceptions import NotFound
@ -67,6 +68,8 @@ class BalancePlugin(Plugin):
super(BalancePlugin, self).__init__(config)
from . import routes
self.migrations_path = (pathlib.Path(__file__).parent / "migrations").resolve()
@plugins_loaded
def post_loaded(*args, **kwargs):
if config.get("allow_service_debit", False) and "events" in current_app.config["FG_PLUGINS"]:

View File

@ -1,5 +1,6 @@
"""Pricelist plugin"""
import pathlib
from flask import Blueprint, jsonify, request, current_app
from werkzeug.local import LocalProxy
from werkzeug.exceptions import BadRequest, Forbidden, NotFound, Unauthorized
@ -24,6 +25,7 @@ class PriceListPlugin(Plugin):
def __init__(self, cfg):
super().__init__(cfg)
self.migrations_path = (pathlib.Path(__file__).parent / "migrations").resolve()
config = {"discount": 0}
config.update(cfg)