Added check if database is not created.

This commit is contained in:
Alexey Sokolov
2022-08-11 23:31:36 +03:00
parent 8b2bcd29e5
commit e759b69b86
2 changed files with 5 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ Create database file and tables if not exists.
*(text, not null)*.
"""
import sqlite3
import logging
CREATE_SERVICES_TABLE = '''CREATE TABLE IF NOT EXISTS services (
@@ -75,3 +76,4 @@ def create_tables_if_not_exists(dbfile: str) -> None:
connection.commit()
cursor.close()
connection.close()
logging.warning('Database created!')