🔧 chore(base.py): remove unnecessary debug log and add success log for database and tables creation
The debug log statement "Database and tables created" has been removed as it is unnecessary. Instead, a success log statement "Database and tables created successfully" has been added to indicate that the database and tables were created without any errors. This improves the clarity of the log messages and provides better feedback during the database setup process.
This commit is contained in:
parent
35e0ea9d80
commit
c1175e4961
1 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,6 @@ engine = create_engine(settings.database_url, connect_args=connect_args)
|
|||
def create_db_and_tables():
|
||||
logger.debug("Creating database and tables")
|
||||
SQLModel.metadata.create_all(engine)
|
||||
logger.debug("Database and tables created")
|
||||
# Now check if the table Flow exists, if not, something went wrong
|
||||
# and we need to create the tables again.
|
||||
from sqlalchemy import inspect
|
||||
|
|
@ -23,6 +22,8 @@ def create_db_and_tables():
|
|||
logger.error("Something went wrong creating the database and tables.")
|
||||
logger.error("Please check your database settings.")
|
||||
raise RuntimeError("Something went wrong creating the database and tables.")
|
||||
else:
|
||||
logger.debug("Database and tables created successfully")
|
||||
|
||||
|
||||
def get_session():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue