From 3ba7e00b6c6582ce85ccf788f91db710503549a1 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 5 Jul 2024 19:12:36 +0800 Subject: [PATCH] Revert "feature: Adds the option to supress MetaData.create_all call" --- casbin_sqlalchemy_adapter/adapter.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/casbin_sqlalchemy_adapter/adapter.py b/casbin_sqlalchemy_adapter/adapter.py index 75c4579..62df9a5 100644 --- a/casbin_sqlalchemy_adapter/adapter.py +++ b/casbin_sqlalchemy_adapter/adapter.py @@ -56,7 +56,7 @@ class Filter: class Adapter(persist.Adapter, persist.adapters.UpdateAdapter): """the interface for Casbin adapters.""" - def __init__(self, engine, db_class=None, filtered=False, create_all_models=True): + def __init__(self, engine, db_class=None, filtered=False): if isinstance(engine, str): self._engine = create_engine(engine) else: @@ -82,8 +82,7 @@ def __init__(self, engine, db_class=None, filtered=False, create_all_models=True self._db_class = db_class self.session_local = sessionmaker(bind=self._engine) - if create_all_models: - Base.metadata.create_all(self._engine) + Base.metadata.create_all(self._engine) self._filtered = filtered @contextmanager