From 6931b000692b9dc2f0e4cc27c385dc54062216e3 Mon Sep 17 00:00:00 2001 From: Gunther Cox Date: Sat, 10 Jun 2017 08:47:34 -0400 Subject: [PATCH] Create tables if they do not exist --- chatterbot/storage/sql_storage.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chatterbot/storage/sql_storage.py b/chatterbot/storage/sql_storage.py index 5db3ab441..0d3cd8b1a 100644 --- a/chatterbot/storage/sql_storage.py +++ b/chatterbot/storage/sql_storage.py @@ -100,9 +100,7 @@ def __init__(self, **kwargs): "read_only", False ) - create = self.kwargs.get("create", False) - - if not self.read_only and create: + if not self.engine.dialect.has_table(self.engine, 'StatementTable'): self.create() self.Session = sessionmaker(bind=self.engine, expire_on_commit=True)