ENV OSMPOL_DATABASE_HOST mongo
ENV OSMPOL_DATABASE_PORT 27017
-ENV OSMPOL_SQL_DATABASE_URI sqlite:///mon_sqlite.db
+ENV OSMPOL_SQL_DATABASE_URI sqlite:///policy_module.db
ENV OSMPOL_LOG_LEVEL INFO
ENV OSMPOL_KAFKA_LOG_LEVEL WARN
CfgParam('OSMPOL_DATABASE_DRIVER', "mongo", six.text_type),
CfgParam('OSMPOL_DATABASE_HOST', "mongo", six.text_type),
CfgParam('OSMPOL_DATABASE_PORT', 27017, int),
- CfgParam('OSMPOL_SQL_DATABASE_URI', "sqlite:///mon_sqlite.db", six.text_type),
+ CfgParam('OSMPOL_SQL_DATABASE_URI', "sqlite:///policy_module.db", six.text_type),
CfgParam('OSMPOL_LOG_LEVEL', "INFO", six.text_type),
CfgParam('OSMPOL_KAFKA_LOG_LEVEL', "WARN", six.text_type),
]
import logging
from peewee import CharField, IntegerField, ForeignKeyField, Model, TextField, AutoField, DateTimeField
-from playhouse.sqlite_ext import SqliteExtDatabase
+from playhouse.db_url import connect
from osm_policy_module.core.config import Config
log = logging.getLogger(__name__)
cfg = Config.instance()
-db = SqliteExtDatabase('policy_module.db')
+db = connect(cfg.OSMPOL_SQL_DATABASE_URI)
class BaseModel(Model):